Commit e1a0376a authored by maruel@chromium.org's avatar maruel@chromium.org

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
parent 98246291
......@@ -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:
......
......@@ -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.
......
......@@ -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):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment