[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

SVN 1.6.x: file copy source is lost when moving a containing directory

From: Dmitry Pavlenko <pavlenko_at_tmatesoft.com>
Date: Thu, 15 Nov 2012 18:12:13 +0400

Hello,

If I move a locally added directory with a moved file, the file's copy-source is lost. The problem is
reproducible with 1.6.x but is not reproducible with 1.7.x.

Is this expected for 1.6?

I've written a test that could be applied to branches/1.6.x:

[[[
Add a test that moves an added directory with a moved file inside. For SVN 1.6.x the file's
copy-source is lost. Currently the test fail.

* subversion/tests/cmdline/copy_tests.py
  (move_added_directory_with_moved_file): New.
  (test_list): Add new test.
]]]
[[[
Index: subversion/tests/cmdline/copy_tests.py
===================================================================
--- subversion/tests/cmdline/copy_tests.py (revision 1409762)
+++ subversion/tests/cmdline/copy_tests.py (working copy)
@@ -4123,7 +4123,28 @@ def copy_broken_symlink(sbox):
 
   svntest.actions.run_and_verify_status(wc_dir, expected_status)
 
+def move_added_directory_with_moved_file(sbox):
+ """moving an added directory with a moved file"""
+ sbox.build()
+ wc_dir = sbox.wc_dir
 
+ X_path = os.path.join(wc_dir, 'X')
+ iota_path = os.path.join(wc_dir, 'iota')
+ X2_path = os.path.join(wc_dir, 'X2')
+
+ svntest.actions.run_and_verify_svn(None, None, [], 'mkdir', X_path)
+ svntest.actions.run_and_verify_svn(None, None, [], 'mv', iota_path, X_path)
+ svntest.actions.run_and_verify_svn(None, None, [], 'mv', X_path, X2_path)
+
+ # check that moved file copy source is not lost
+ expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+ expected_status.tweak('iota', status='D ')
+ expected_status.add({'X2' : Item(status='A ', wc_rev=0) })
+ expected_status.add({'X2/iota' : Item(status='A+', wc_rev=0) })
+
+ svntest.actions.run_and_verify_status(wc_dir, expected_status)
+
+
 ########################################################################
 # Run the tests
 
@@ -4207,6 +4228,7 @@ test_list = [ None,
               path_move_and_copy_between_wcs_2475,
               path_copy_in_repo_2475,
               SkipUnless(copy_broken_symlink, svntest.main.is_posix_os),
+ XFail(move_added_directory_with_moved_file),
              ]
 
 if __name__ == '__main__':
]]]

--
Dmitry Pavlenko,
TMate Software,
http://subgit.com/ - git-svn bridge
Received on 2012-11-15 15:14:21 CET

This is an archived mail posted to the Subversion Dev mailing list.