Author: philip
Date: Wed Jul 7 14:54:18 2010
New Revision: 961397
URL: http://svn.apache.org/viewvc?rev=961397&view=rev
Log:
Fix issue 3673, move a directory containing a moved node.
* subversion/libsvn_wc/wc_db.c
(get_info_for_copy): Scan for repos info when not added.
* subversion/tests/cmdline/copy_tests.py
(move_dir_containing_move): New.
(test_list): Add move_dir_containing_move.
Modified:
subversion/trunk/subversion/libsvn_wc/wc_db.c
subversion/trunk/subversion/tests/cmdline/copy_tests.py
Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=961397&r1=961396&r2=961397&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Wed Jul 7 14:54:18 2010
@@ -2851,6 +2851,10 @@ get_info_for_copy(apr_int64_t *copyfrom_
{
*copyfrom_relpath = repos_relpath;
*copyfrom_rev = revision;
+ if (!repos_root_url || !repos_uuid)
+ SVN_ERR(svn_wc__db_scan_base_repos(NULL, &repos_root_url, &repos_uuid,
+ db, local_abspath,
+ scratch_pool, scratch_pool));
SVN_ERR(create_repos_id(copyfrom_id,
repos_root_url, repos_uuid,
pdh->wcroot->sdb, scratch_pool));
Modified: subversion/trunk/subversion/tests/cmdline/copy_tests.py
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/copy_tests.py?rev=961397&r1=961396&r2=961397&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/copy_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/copy_tests.py Wed Jul 7 14:54:18
2010
@@ -4494,6 +4494,52 @@ def copy_broken_symlink(sbox):
svntest.actions.run_and_verify_status(wc_dir, expected_status)
+def move_dir_containing_move(sbox):
+ """move a directory containing moved node"""
+
+ sbox.build()
+ svntest.actions.run_and_verify_svn(None, None, [], 'mv',
+ sbox.ospath('A/B/E/alpha'),
+ sbox.ospath('A/B/E/alpha_moved'))
+
+ svntest.actions.run_and_verify_svn(None, None, [], 'mv',
+ sbox.ospath('A/B/E'),
+ sbox.ospath('A/B/E_moved'))
+
+ expected_status = svntest.actions.get_virginal_state(sbox.wc_dir, 1)
+ expected_status.tweak('A/B/E', 'A/B/E/alpha', 'A/B/E/beta', status='D ')
+ expected_status.add({
+ 'A/B/E_moved' : Item(status='A ', copied='+', wc_rev='-'),
+ 'A/B/E_moved/alpha' : Item(status='D ', wc_rev='?'),
+ 'A/B/E_moved/alpha_moved' : Item(status='A ', copied='+', wc_rev='-'),
+ 'A/B/E_moved/beta' : Item(status=' ', copied='+', wc_rev='-'),
+ })
+
+ # ### run_and_verify_status seems to expect alpha to be both
+ # ### wc_rev='?' and wc_rev='1' so it's disabled for now
+
+ #svntest.actions.run_and_verify_status(sbox.wc_dir, expected_status)
+
+ expected_output = svntest.wc.State(sbox.wc_dir, {
+ 'A/B/E' : Item(verb='Deleting'),
+ 'A/B/E_moved' : Item(verb='Adding'),
+ 'A/B/E_moved/alpha' : Item(verb='Deleting'),
+ 'A/B/E_moved/alpha_moved': Item(verb='Adding'),
+ })
+
+ expected_status.tweak('A/B/E_moved',
+ 'A/B/E_moved/alpha_moved',
+ 'A/B/E_moved/beta',
+ status=' ', copied=None, wc_rev='2')
+ expected_status.remove('A/B/E',
+ 'A/B/E/alpha',
+ 'A/B/E/beta',
+ 'A/B/E_moved/alpha')
+ svntest.actions.run_and_verify_commit(sbox.wc_dir,
+ expected_output,
+ expected_status,
+ None, sbox.wc_dir)
+
########################################################################
# Run the tests
@@ -4583,6 +4629,7 @@ test_list = [ None,
XFail(nonrecursive_commit_of_copy),
copy_added_dir_with_copy,
SkipUnless(copy_broken_symlink, svntest.main.is_posix_os),
+ move_dir_containing_move,
]
if __name__ == '__main__':