You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2018/07/20 10:21:48 UTC
svn commit: r1836340 -
/subversion/trunk/subversion/tests/cmdline/patch_tests.py
Author: julianfoad
Date: Fri Jul 20 10:21:48 2018
New Revision: 1836340
URL: http://svn.apache.org/viewvc?rev=1836340&view=rev
Log:
subversion/tests/cmdline/patch_tests.py
(patch_git_wcroot2): New test.
(test_list): Run it.
Modified:
subversion/trunk/subversion/tests/cmdline/patch_tests.py
Modified: subversion/trunk/subversion/tests/cmdline/patch_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/patch_tests.py?rev=1836340&r1=1836339&r2=1836340&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/patch_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/patch_tests.py Fri Jul 20 10:21:48 2018
@@ -7965,6 +7965,51 @@ def patch_git_wcroot(sbox):
svntest.actions.check_prop('p', wc_dir, [value.encode()])
+# Test that 'patch' can apply a patch that modifies properties on the root
+# of a WC and/or the root of a repository. This test performs a round-trip
+# through 'diff --git' and 'patch' rather than assuming any particular
+# variant of the patch format.
+#
+# See dev@ email thread 2018-07-09 from Dmitry Pavlenko,
+# '[PATCH] can't "svn patch" working copy root if the patch is in --git format',
+# https://lists.apache.org/thread.html/d1d9811ca36fac8cabb9339634840099e22811beac505be2ea59f19f@%3Cdev.subversion.apache.org%3E
+@XFail()
+def patch_git_wcroot2(sbox):
+ "patch working copy root"
+ sbox.build(empty=True)
+ wc_dir = sbox.wc_dir
+
+ value = 'v'
+ sbox.simple_propset('p', value, '')
+ exit_code, git_patch, err_output = svntest.main.run_svn(None, 'diff',
+ '--git', wc_dir)
+
+ patch_file_path = sbox.get_tempname('my.patch')
+ svntest.main.file_write(patch_file_path, ''.join(git_patch), 'wb')
+
+ sbox.simple_revert('')
+
+ expected_output = wc.State(wc_dir, {
+ '.' : Item(status=' U'),
+ })
+ expected_disk = svntest.wc.State('', {})
+ expected_disk.add({'': Item(props={'p' : value })})
+ expected_status = svntest.wc.State(wc_dir, {})
+ expected_status.add({'': Item(status=' M', wc_rev='0')})
+ expected_skip = wc.State('', { })
+
+ svntest.actions.run_and_verify_patch(wc_dir, patch_file_path,
+ expected_output,
+ expected_disk,
+ expected_status,
+ expected_skip,
+ None, # expected err
+ True, # check-props
+ False, # dry-run
+ )
+
+ svntest.actions.check_prop('p', wc_dir, [value.encode()])
+
########################################################################
#Run the tests
@@ -8051,6 +8096,7 @@ test_list = [ None,
patch_mergeinfo_in_regular_prop_format,
patch_empty_prop,
patch_git_wcroot,
+ patch_git_wcroot2,
]
if __name__ == '__main__':