[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] mode-changing patches ∩ binary patches

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Mon, 28 Sep 2015 18:25:43 +0000

svn.apache.org doesn't let me commit this, even though it accepts my
password...

[[[
patch: Make binary patches and git mode changes coexist.

* subversion/libsvn_diff/parse-diff.c
  (transitions): Add missing transition.

* subversion/tests/cmdline/patch_tests.py
  (patch_binary_file): Tweak the test to trigger the new codepath.
]]]

[[[
Index: subversion/libsvn_diff/parse-diff.c
===================================================================
--- subversion/libsvn_diff/parse-diff.c (revision 1705734)
+++ subversion/libsvn_diff/parse-diff.c (working copy)
@@ -2038,6 +2038,7 @@ static struct transition transitions[] =
 
   {"GIT binary patch", state_git_diff_seen, binary_patch_start},
   {"GIT binary patch", state_git_tree_seen, binary_patch_start},
+ {"GIT binary patch", state_git_mode_seen, binary_patch_start},
 };
 
 svn_error_t *
Index: subversion/tests/cmdline/patch_tests.py
===================================================================
--- subversion/tests/cmdline/patch_tests.py (revision 1705734)
+++ subversion/tests/cmdline/patch_tests.py (working copy)
@@ -5659,7 +5659,13 @@ def patch_binary_file(sbox):
   sbox.simple_revert('iota')
 
   tmp = sbox.get_tempname()
- svntest.main.file_write(tmp, ''.join(diff_output))
+ patch = diff_output[:]
+ patch[3:3] = [
+ "old mode 100644\n",
+ "new mode 100755\n",
+ #"index ...\n",
+ ]
+ svntest.main.file_write(tmp, ''.join(patch))
 
   expected_output = wc.State(wc_dir, {
     'iota' : Item(status='UU'),
@@ -5666,7 +5672,8 @@ def patch_binary_file(sbox):
   })
   expected_disk = svntest.main.greek_state.copy()
   expected_disk.tweak('iota',
- props={'svn:mime-type':'application/binary'},
+ props={'svn:mime-type':'application/binary',
+ 'svn:executable': '*'},
                       contents =
                       'This is the file \'iota\'.\n'
                       '\0\202\203\204\205\206\207nsomething\nelse\xFF')
]]]
Received on 2015-09-28 20:26:03 CEST

This is an archived mail posted to the Subversion Dev mailing list.