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 2013/01/21 19:17:44 UTC
svn commit: r1436529 -
/subversion/trunk/subversion/tests/cmdline/patch_tests.py
Author: rhuijben
Date: Mon Jan 21 18:17:43 2013
New Revision: 1436529
URL: http://svn.apache.org/viewvc?rev=1436529&view=rev
Log:
* subversion/tests/cmdline/patch_tests.py
(patch_empty_file): Add new XFail test for issue #3644.
(test_list): Added test.
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=1436529&r1=1436528&r2=1436529&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/patch_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/patch_tests.py Mon Jan 21 18:17:43 2013
@@ -4395,6 +4395,38 @@ def single_line_mismatch(sbox):
svntest.actions.run_and_verify_svn(None, expected_output, [],
'patch', patch_file_path, wc_dir)
+@Issue(3644)
+@XFail()
+def patch_empty_file(sbox):
+ "apply a patch to an empty file"
+
+ sbox.build()
+ wc_dir = sbox.wc_dir
+
+ patch_file_path = make_patch_path(sbox)
+ svntest.main.file_write(patch_file_path, ''.join([
+ "Index: file1.txt\n",
+ "===================================================================\n",
+ "--- file1.txt\t(revision 20)\n",
+ "+++ file1.txt\t(working copy)\n",
+ "@@ -0,0 +1 @@\n",
+ "+vhjhgf\n",
+ "\\ No newline at end of file\n",
+ ]))
+
+ # Add a 0-byte file 'file1.txt'
+ sbox.simple_add_text('', 'file1.txt')
+ sbox.simple_commit()
+
+ # And now this patch should fail, as 'line' doesn't equal 'foo'
+ # But yet it shows up as deleted instead of conflicted
+ expected_output = [
+ 'U %s\n' % sbox.ospath('file1.txt'),
+ ]
+
+ svntest.actions.run_and_verify_svn(None, expected_output, [],
+ 'patch', patch_file_path, wc_dir)
+
########################################################################
#Run the tests
@@ -4444,6 +4476,7 @@ test_list = [ None,
patch_change_symlink_target,
patch_replace_dir_with_file_and_vv,
single_line_mismatch,
+ patch_empty_file,
]
if __name__ == '__main__':