Fix an issue where calling `svn copy` between two different working copies
could fail if they had different --store-pristine settings.
Before this change, we were transferring the low-level pristine information
(sqlite entries and files) from one db to another. This is no longer enough
for some of the cases. For example, there is a case where we need to copy
from a WC that doesn't store pristines locally into a WC that does, and the
source pristine contents should be read from an unmodified working file.
This changeset switches to a more generic approach where we read and install
the pristine contents using the wc_textbase layer that automatically handles
such cases.
* subversion/libsvn_wc/copy.c
(copy_versioned_file): Accept the `within_one_wc` parameter.
Use the textbase layer to read and install the pristines when the copy
happens between two different WCs.
(copy_versioned_dir): Accept and propagate the `within_one_wc` parameter.
(copy_or_move): No longer call svn_wc__db_pristine_transfer(). Pass the
local `within_one_wc` variable further.
* subversion/libsvn_wc/wc_db.h
(svn_wc__db_pristine_transfer): Remove.
* subversion/libsvn_wc/wc_db_pristine.c
(maybe_transfer_one_pristine,
pristine_transfer_txn,
svn_wc__db_pristine_transfer): Remove.
* subversion/libsvn_wc/wc-queries.sql
(STMT_SELECT_COPY_PRISTINES_F31,
STMT_SELECT_COPY_PRISTINES_F32): Remove. Also remove these statements …
* subversion/tests/libsvn_wc/wc-queries-test.c
(stmt_matches_wc_format): …from here.
* subversion/tests/cmdline/store_pristine_tests.py
(copy_cross_wc_without_src_pristine): New regression test.
(copy_cross_wc_without_dst_pristine): New test.
(test_list): Run the new tests.
* subversion/tests/libsvn_client/client-test.c
(test_wc_add_scenarios): Skip when running for a working copy without
pristines. Despite being located in client-test.c, here we test the
low-level svn_wc APIs that require svn_wc_textbase_sync() calls to work
for WCs without pristines. For now, let's keep testing the old behavior,
just for WCs that store all pristines locally.
git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1908573 13f79535-47bb-0310-9956-ffa450edef68
7 files changed