/[Apache-SVN]
ViewVC logotype

Revision 1908573


Jump to revision: Previous Next
Author: kotkov
Date: Mon Mar 20 14:59:18 2023 UTC (13 months, 2 weeks ago)
Changed paths: 7
Log Message:
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.


Changed paths

Path Details
Directorysubversion/trunk/subversion/libsvn_wc/copy.c modified , text changed
Directorysubversion/trunk/subversion/libsvn_wc/wc-queries.sql modified , text changed
Directorysubversion/trunk/subversion/libsvn_wc/wc_db.h modified , text changed
Directorysubversion/trunk/subversion/libsvn_wc/wc_db_pristine.c modified , text changed
Directorysubversion/trunk/subversion/tests/cmdline/store_pristine_tests.py modified , text changed
Directorysubversion/trunk/subversion/tests/libsvn_client/client-test.c modified , text changed
Directorysubversion/trunk/subversion/tests/libsvn_wc/wc-queries-test.c modified , text changed

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.26