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

Enable support to remove the executable bit on the CQ.

R=petermayo@chromium.org
BUG=124817


Review URL: https://chromiumcodereview.appspot.com/10890039

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@153908 0039d316-1c4b-4281-b951-d872f2087c98
parent 17fa4bee
...@@ -357,9 +357,13 @@ class SvnCheckout(CheckoutBase, SvnMixIn): ...@@ -357,9 +357,13 @@ class SvnCheckout(CheckoutBase, SvnMixIn):
# using above. # using above.
stdout += self._check_output_svn( stdout += self._check_output_svn(
['add', p.filename, '--force'], credentials=False) ['add', p.filename, '--force'], credentials=False)
for prop in p.svn_properties: for name, value in p.svn_properties:
stdout += self._check_output_svn( if value is None:
['propset', prop[0], prop[1], p.filename], credentials=False) stdout += self._check_output_svn(
['propdel', '--quiet', name, p.filename], credentials=False)
else:
stdout += self._check_output_svn(
['propset', name, value, p.filename], credentials=False)
for prop, values in self.svn_config.auto_props.iteritems(): for prop, values in self.svn_config.auto_props.iteritems():
if fnmatch.fnmatch(p.filename, prop): if fnmatch.fnmatch(p.filename, prop):
for value in values.split(';'): for value in values.split(';'):
...@@ -528,18 +532,18 @@ class GitCheckoutBase(CheckoutBase): ...@@ -528,18 +532,18 @@ class GitCheckoutBase(CheckoutBase):
# p.diff_hunks. git apply manages all that already. # p.diff_hunks. git apply manages all that already.
stdout += self._check_output_git( stdout += self._check_output_git(
['apply', '--index', '-p%s' % p.patchlevel], stdin=p.get(True)) ['apply', '--index', '-p%s' % p.patchlevel], stdin=p.get(True))
for prop in p.svn_properties: for name, _ in p.svn_properties:
# Ignore some known auto-props flags through .subversion/config, # Ignore some known auto-props flags through .subversion/config,
# bails out on the other ones. # bails out on the other ones.
# TODO(maruel): Read ~/.subversion/config and detect the rules that # TODO(maruel): Read ~/.subversion/config and detect the rules that
# applies here to figure out if the property will be correctly # applies here to figure out if the property will be correctly
# handled. # handled.
if not prop[0] in ( if not name in (
'svn:eol-style', 'svn:executable', 'svn:mime-type'): 'svn:eol-style', 'svn:executable', 'svn:mime-type'):
raise patch.UnsupportedPatchFormat( raise patch.UnsupportedPatchFormat(
p.filename, p.filename,
'Cannot apply svn property %s to file %s.' % ( 'Cannot apply svn property %s to file %s.' % (
prop[0], p.filename)) name, p.filename))
for post in post_processors: for post in post_processors:
post(self, p) post(self, p)
except OSError, e: except OSError, e:
......
...@@ -404,9 +404,10 @@ class FilePatchDiff(FilePatchBase): ...@@ -404,9 +404,10 @@ class FilePatchDiff(FilePatchBase):
if match: if match:
mode = match.group(2) mode = match.group(2)
# Only look at owner ACL for executable. # Only look at owner ACL for executable.
# TODO(maruel): Add support to remove a property.
if bool(int(mode[4]) & 1): if bool(int(mode[4]) & 1):
self.svn_properties.append(('svn:executable', '*')) self.svn_properties.append(('svn:executable', '*'))
else:
self.svn_properties.append(('svn:executable', None))
return return
match = re.match(r'^--- (.*)$', line) match = re.match(r'^--- (.*)$', line)
......
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