You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2017/07/31 22:18:47 UTC

svn commit: r1803591 - /subversion/branches/addremove/subversion/tests/cmdline/addremove_tests.py

Author: stsp
Date: Mon Jul 31 22:18:47 2017
New Revision: 1803591

URL: http://svn.apache.org/viewvc?rev=1803591&view=rev
Log:
On the addremove branch, add a regression test.

* subversion/tests/cmdline/addremove_tests.py
  (addremove_unversioned_move_file): New test with an unversioned file move.
  (test_lits): Add new test.

Modified:
    subversion/branches/addremove/subversion/tests/cmdline/addremove_tests.py

Modified: subversion/branches/addremove/subversion/tests/cmdline/addremove_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/addremove/subversion/tests/cmdline/addremove_tests.py?rev=1803591&r1=1803590&r2=1803591&view=diff
==============================================================================
--- subversion/branches/addremove/subversion/tests/cmdline/addremove_tests.py (original)
+++ subversion/branches/addremove/subversion/tests/cmdline/addremove_tests.py Mon Jul 31 22:18:47 2017
@@ -98,6 +98,26 @@ def addremove_ignore(sbox):
   expected_output = svntest.actions.get_virginal_state(wc_dir, 1)
   svntest.actions.run_and_verify_status(wc_dir, expected_output)
 
+def addremove_unversioned_move_file(sbox):
+  "addremove detects unversioned file moves"
+
+  sbox.build()
+  wc_dir = sbox.wc_dir
+
+  # Manually move a versioned file
+  oldfile_path = sbox.ospath('A/mu')
+  newfile_path = sbox.ospath('A/mu-moved')
+  os.rename(oldfile_path, newfile_path)
+
+  svntest.actions.run_and_verify_svn(None, [], 'addremove', wc_dir)
+
+  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+  expected_status.tweak('A/mu', status='D ', moved_to='A/mu-moved')
+  expected_status.add({
+    'A/mu-moved' : Item(status='A ', wc_rev='-', moved_from='A/mu', copied='+'),
+  })
+  svntest.actions.run_and_verify_status(wc_dir, expected_status)
+
 ########################################################################
 # Run the tests
 
@@ -105,6 +125,7 @@ def addremove_ignore(sbox):
 test_list = [ None,
               basic_addremove,
               addremove_ignore,
+              addremove_unversioned_move_file,
 ]
 
 if __name__ == '__main__':