subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danie...@apache.org
Subject svn commit: r1139256 - /subversion/trunk/subversion/tests/cmdline/revert_tests.py
Date Fri, 24 Jun 2011 11:48:32 GMT
Author: danielsh
Date: Fri Jun 24 11:48:32 2011
New Revision: 1139256

URL: http://svn.apache.org/viewvc?rev=1139256&view=rev
Log:
Add a regression test for issue #3938, "revert throws an error for unversioned
targets".

* subversion/tests/cmdline/revert_tests.py
  (revert_with_unversioned_targets): New test, XFail.
  (test_list): Run it.

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=1139256&r1=1139255&r2=1139256&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/revert_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/revert_tests.py Fri Jun 24 11:48:32 2011
@@ -1548,6 +1548,45 @@ def revert_no_text_change_conflict_recur
   expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
   svntest.actions.run_and_verify_status(wc_dir, expected_status)
 
+@XFail()
+@Issue(3938)
+def revert_with_unversioned_targets(sbox):
+  "revert with unversioned targets"
+
+  sbox.build()
+  wc_dir = sbox.wc_dir
+
+  chi_path = sbox.ospath('A/D/H/chi')
+  delta_path = sbox.ospath('A/D/H/delta')
+  psi_path = sbox.ospath('A/D/H/psi')
+
+  chi_contents = "modified chi\n"
+  delta_contents = "This is the unversioned file 'delta'.\n"
+  psi_contents = "modified psi\n"
+
+  # touch delta
+  open(delta_path, 'w').write(delta_contents)
+
+  # modify chi psi
+  open(chi_path, 'w').write(chi_contents)
+  open(psi_path, 'w').write(psi_contents)
+
+  # revert
+  expected_output = svntest.verify.UnorderedOutput([
+    "Reverted '%s'\n" % sbox.ospath('A/D/H/chi'),
+    "Reverted '%s'\n" % sbox.ospath('A/D/H/psi'),
+  ])
+  svntest.actions.run_and_verify_svn(None, expected_output, [],
+                                     'revert', chi_path, delta_path, psi_path)
+
+  # verify disk
+  expected_disk = svntest.main.greek_state.copy()
+  expected_disk.add({
+    'A/D/H/delta': Item(delta_contents),
+  })
+  actual_disk = svntest.tree.build_tree_from_wc(wc_dir, 1)
+  svntest.tree.compare_trees("disk", actual_disk, expected_disk.old_tree())
+
 ########################################################################
 # Run the tests
 
@@ -1585,6 +1624,7 @@ test_list = [ None,
               revert_empty_actual_recursive,
               revert_no_text_change_conflict,
               revert_no_text_change_conflict_recursive,
+              revert_with_unversioned_targets,
              ]
 
 if __name__ == '__main__':



Mime
View raw message