Author: julianfoad
Date: Tue Jun 23 08:37:31 2015
New Revision: 1686988
URL: http://svn.apache.org/r1686988
Log:
Add a regression test for update failing to update keywords when the incoming
change is equal to the local change.
Found by: Vincent Lefevre <vincent-svn{_AT_}vinc17.net>
See the email thread "keywords not updated after an update that doesn't
change the file due to local changes" started on 2015-06-17, e.g.
<http://svn.haxx.se/dev/archive-2015-06/0147.shtml>.
* subversion/tests/cmdline/update_tests.py
(update_keywords_on_shortcut): New test, marked as XFail.
(test_list): Run it.
Modified:
subversion/trunk/subversion/tests/cmdline/update_tests.py
Modified: subversion/trunk/subversion/tests/cmdline/update_tests.py
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/update_tests.py?rev=1686988&r1=1686987&r2=1686988&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/update_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/update_tests.py Tue Jun 23
08:37:31 2015
@@ -6694,6 +6694,46 @@ def update_conflict_details(sbox):
svntest.actions.run_and_verify_info(expected_info, sbox.ospath('A/B'),
'--depth', 'infinity')
+# Keywords should be updated in local file even if text change is shortcut
+# (due to the local change being the same as the incoming change, for example).
+@XFail()
+def update_keywords_on_shortcut(sbox):
+ "update_keywords_on_shortcut"
+
+ sbox.build()
+ wc_dir = sbox.wc_dir
+
+ # Start with a file with keywords expanded
+ mu_path = sbox.ospath('A/mu')
+ svntest.main.file_append(mu_path, '$LastChangedRevision$\n')
+ svntest.main.run_svn(None, 'ps', 'svn:keywords', 'LastChangedRevision',
mu_path)
+ sbox.simple_commit('A/mu')
+
+ # Modify the text, and commit
+ svntest.main.file_append(mu_path, 'New line.\n')
+ sbox.simple_commit('A/mu')
+
+ # Update back to the previous revision
+ sbox.simple_update('A/mu', 2)
+
+ # Make the same change again locally
+ svntest.main.file_append(mu_path, 'New line.\n')
+
+ # Update, so that merging the text change is a short-cut merge
+ text_before_up = open(sbox.ospath('A/mu'), 'r').readlines()
+ sbox.simple_update('A/mu')
+ text_after_up = open(sbox.ospath('A/mu'), 'r').readlines()
+
+ # Check the keywords have been updated
+ print 'old: ' + repr(text_before_up)
+ print 'new: ' + repr(text_after_up)
+ if not any(['$LastChangedRevision: 2 $' in line
+ for line in text_before_up]):
+ raise svntest.Failure("keyword not as expected in test set-up phase")
+ if not any(['$LastChangedRevision: 3 $' in line
+ for line in text_after_up]):
+ raise svntest.Failure("update did not update the LastChangedRevision
keyword")
+
#######################################################################
# Run the tests
@@ -6780,6 +6820,7 @@ test_list = [ None,
bump_below_tree_conflict,
update_child_below_add,
update_conflict_details,
+ update_keywords_on_shortcut,
]
if __name__ == '__main__':