From e1a0376aa1aaf2a067e4eaba1dd920765ba5c2d2 Mon Sep 17 00:00:00 2001 From: "maruel@chromium.org" Date: Mon, 24 Sep 2012 15:28:52 +0000 Subject: [PATCH] Fix applying svn:executable on Windows. For an unknown reason, 'svn propset svn:executable * foo.sh' doesn't work on Windows. It is even more awkward that 'svn propset svn:executable . foo.sh' works just fine, in particular, subversion replaces the value, as long as it's not an empty string, back to '*'. R=petermayo@chromium.org BUG= Review URL: https://chromiumcodereview.appspot.com/10967071 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@158281 0039d316-1c4b-4281-b951-d872f2087c98 --- checkout.py | 5 ++++- patch.py | 2 +- tests/patch_test.py | 6 +++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/checkout.py b/checkout.py index c8f240a61..217a5a5a4 100644 --- a/checkout.py +++ b/checkout.py @@ -366,9 +366,12 @@ class SvnCheckout(CheckoutBase, SvnMixIn): if fnmatch.fnmatch(p.filename, prop): for value in values.split(';'): if '=' not in value: - params = [value, '*'] + params = [value, '.'] else: params = value.split('=', 1) + if params[1] == '*': + # Works around crbug.com/150960 on Windows. + params[1] = '.' stdout += self._check_output_svn( ['propset'] + params + [p.filename], credentials=False) for post in post_processors: diff --git a/patch.py b/patch.py index 54f5d175a..9083094e8 100644 --- a/patch.py +++ b/patch.py @@ -405,7 +405,7 @@ class FilePatchDiff(FilePatchBase): mode = match.group(2) # Only look at owner ACL for executable. if bool(int(mode[4]) & 1): - self.svn_properties.append(('svn:executable', '*')) + self.svn_properties.append(('svn:executable', '.')) elif not self.source_filename and self.is_new: # It's a new file, not from a rename/copy, then there's no property to # delete. diff --git a/tests/patch_test.py b/tests/patch_test.py index 5a442d07f..e932abb29 100755 --- a/tests/patch_test.py +++ b/tests/patch_test.py @@ -82,13 +82,13 @@ class PatchTest(unittest.TestCase): p = patch.FilePatchDiff('git_cl/git-cl', GIT.MODE_EXE, []) self._check_patch( p, 'git_cl/git-cl', GIT.MODE_EXE, is_git_diff=True, patchlevel=1, - svn_properties=[('svn:executable', '*')], nb_hunks=0) + svn_properties=[('svn:executable', '.')], nb_hunks=0) def testFilePatchDiffHeaderModeIndex(self): p = patch.FilePatchDiff('git_cl/git-cl', GIT.MODE_EXE_JUNK, []) self._check_patch( p, 'git_cl/git-cl', GIT.MODE_EXE_JUNK, is_git_diff=True, patchlevel=1, - svn_properties=[('svn:executable', '*')], nb_hunks=0) + svn_properties=[('svn:executable', '.')], nb_hunks=0) def testFilePatchDiffHeaderNotExecutable(self): p = patch.FilePatchDiff( @@ -332,7 +332,7 @@ class PatchTest(unittest.TestCase): is_new=True, is_git_diff=True, patchlevel=1, - svn_properties=[('svn:executable', '*')], + svn_properties=[('svn:executable', '.')], nb_hunks=1) def testGitNewMode(self):