You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ne...@apache.org on 2011/08/18 00:10:39 UTC

svn commit: r1158936 - /subversion/trunk/subversion/tests/cmdline/revert_tests.py

Author: neels
Date: Wed Aug 17 22:10:39 2011
New Revision: 1158936

URL: http://svn.apache.org/viewvc?rev=1158936&view=rev
Log:
* subversion/tests/cmdline/revert_tests.py (revert_moved_file):
    Issue #876 is rejected. Make the corresponding test not fail and unmark
    XFail. Remake the test using svntest.factory. Change the indent to match
    the rest of the file.

Modified:
    subversion/trunk/subversion/tests/cmdline/revert_tests.py

Modified: subversion/trunk/subversion/tests/cmdline/revert_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/revert_tests.py?rev=1158936&r1=1158935&r2=1158936&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/revert_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/revert_tests.py Wed Aug 17 22:10:39 2011
@@ -368,37 +368,52 @@ def revert_replaced_file_without_props(s
   svntest.actions.run_and_verify_status(wc_dir, expected_status)
 
 #----------------------------------------------------------------------
-# Regression test for issue #876:
-# svn revert of an svn move'd file does not revert the file
-@XFail()
+# Note that issue #876 has been rejected. This now basically tests that
+# reverting the delete side of a move does *not* also revert the copy side.
 @Issue(876)
 def revert_moved_file(sbox):
-    "revert a moved file"
+  "revert a moved file"
+
+  # svntest.factory.make(sbox, """svn mv iota iota_moved
+  #                               svn st
+  #                               svn revert iota
+  #                               svn st
+  #                               """)
+
+  sbox.build()
+  wc_dir = sbox.wc_dir
+
+  iota = os.path.join(wc_dir, 'iota')
+  iota_moved = os.path.join(wc_dir, 'iota_moved')
+
+  # svn mv iota iota_moved
+  expected_stdout = svntest.verify.UnorderedOutput([
+    'A         ' + iota_moved + '\n',
+    'D         ' + iota + '\n',
+  ])
+
+  actions.run_and_verify_svn2('OUTPUT', expected_stdout, [], 0, 'mv', iota,
+    iota_moved)
+
+  # svn st
+  expected_status = actions.get_virginal_state(wc_dir, 1)
+  expected_status.add({
+    'iota_moved'        : Item(status='A ', copied='+', wc_rev='-'),
+  })
+  expected_status.tweak('iota', status='D ')
+
+  actions.run_and_verify_unquiet_status(wc_dir, expected_status)
+
+  # svn revert iota
+  expected_stdout = ["Reverted '" + iota + "'\n"]
+
+  actions.run_and_verify_svn2('OUTPUT', expected_stdout, [], 0, 'revert',
+    iota)
 
-    sbox.build(read_only = True)
-    wc_dir = sbox.wc_dir
-    iota_path = os.path.join(wc_dir, 'iota')
-    iota_path_moved = os.path.join(wc_dir, 'iota_moved')
-
-    svntest.actions.run_and_verify_svn(None, None, [], 'mv', iota_path,
-                                        iota_path_moved)
-    expected_output = svntest.actions.get_virginal_state(wc_dir, 1)
-    expected_output.tweak('iota', status='D ')
-    expected_output.add({
-      'iota_moved' : Item(status='A ', copied='+', wc_rev='-'),
-    })
-    svntest.actions.run_and_verify_status(wc_dir, expected_output)
-
-    # now revert the file iota
-    svntest.actions.run_and_verify_svn(None,
-      ["Reverted '" + iota_path + "'\n"], [], 'revert', iota_path)
-
-    # at this point, svn status on iota_path_moved should return nothing
-    # since it should disappear on reverting the move, and since svn status
-    # on a non-existent file returns nothing.
+  # svn st
+  expected_status.tweak('iota', status='  ')
 
-    svntest.actions.run_and_verify_svn(None, [], [],
-                                      'status', '-v', iota_path_moved)
+  actions.run_and_verify_unquiet_status(wc_dir, expected_status)
 
 
 #----------------------------------------------------------------------