You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2011/05/11 10:49:27 UTC

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

Author: rhuijben
Date: Wed May 11 08:49:27 2011
New Revision: 1101788

URL: http://svn.apache.org/viewvc?rev=1101788&view=rev
Log:
* subversion/tests/cmdline/revert_tests.py
  (revert_reexpand_keyword): Extend test to show that this feature was broken
    long before my recent changes. (read: probably from the original fix)

    I think this problem deserves a better fix then just reverting to the
    behavior where the first part of this patch works, but stops working
    after a failed commit.

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=1101788&r1=1101787&r2=1101788&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/revert_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/revert_tests.py Wed May 11 08:49:27 2011
@@ -300,9 +300,27 @@ def revert_reexpand_keyword(sbox):
   # Now un-expand the keyword again.
   svntest.main.file_write(newfile_path, unexpanded_contents)
 
-  fp = open(newfile_path, 'r')
-  lines = fp.readlines()
-  fp.close()
+  # Revert the file.  The keyword should reexpand.
+  svntest.main.run_svn(None, 'revert', newfile_path)
+
+  # Verify that the keyword got re-expanded.
+  check_expanded(newfile_path)
+
+  # Now un-expand the keyword again.
+  svntest.main.file_write(newfile_path, unexpanded_contents)
+
+  # And now we trick svn in ignoring the file on newfile_path
+  newfile2_path = newfile_path + '2'
+  svntest.main.file_write(newfile2_path, 'This is file 2')
+  svntest.main.run_svn(None, 'add', newfile2_path)
+  os.remove(newfile2_path)
+
+  # This commit fails because newfile2_path is missing, but only after
+  # we call svn_wc__internal_file_modified_p() on new_file
+  svntest.actions.run_and_verify_commit(wc_dir, None, None, "2' is scheduled"+
+                                        " for addition, but is missing",
+                                        newfile_path, newfile2_path,
+                                        '-m', "Shouldn't be committed")
 
   # Revert the file.  The keyword should reexpand.
   svntest.main.run_svn(None, 'revert', newfile_path)