Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(407)

Side by Side Diff: patch.py

Issue 7112016: +x is bit 0, not 2. :( (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # coding=utf8 1 # coding=utf8
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 """Utility functions to handle patches.""" 5 """Utility functions to handle patches."""
6 6
7 import posixpath 7 import posixpath
8 import os 8 import os
9 import re 9 import re
10 10
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 self._fail( 240 self._fail(
241 'Confused %s from/to git diff for line %s.' % 241 'Confused %s from/to git diff for line %s.' %
242 (match.group(1), line)) 242 (match.group(1), line))
243 return 243 return
244 244
245 # Handle "new file mode \d{6}" 245 # Handle "new file mode \d{6}"
246 match = re.match(r'^new file mode (\d{6})$', line) 246 match = re.match(r'^new file mode (\d{6})$', line)
247 if match: 247 if match:
248 mode = match.group(1) 248 mode = match.group(1)
249 # Only look at owner ACL for executable. 249 # Only look at owner ACL for executable.
250 if bool(int(mode[4]) & 4): 250 if bool(int(mode[4]) & 1):
251 self.svn_properties.append(('svn:executable', '*')) 251 self.svn_properties.append(('svn:executable', '*'))
252 252
253 # Handle "--- " 253 # Handle "--- "
254 match = re.match(r'^--- (.*)$', line) 254 match = re.match(r'^--- (.*)$', line)
255 if match: 255 if match:
256 if last_line[:3] in ('---', '+++'): 256 if last_line[:3] in ('---', '+++'):
257 self._fail('--- and +++ are reversed') 257 self._fail('--- and +++ are reversed')
258 self.is_new = match.group(1) == '/dev/null' 258 self.is_new = match.group(1) == '/dev/null'
259 # TODO(maruel): Use self.source_file. 259 # TODO(maruel): Use self.source_file.
260 if old != self.mangle(match.group(1)) and match.group(1) != '/dev/null': 260 if old != self.mangle(match.group(1)) and match.group(1) != '/dev/null':
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 for patch in self.patches: 347 for patch in self.patches:
348 patch.set_relpath(relpath) 348 patch.set_relpath(relpath)
349 349
350 def __iter__(self): 350 def __iter__(self):
351 for patch in self.patches: 351 for patch in self.patches:
352 yield patch 352 yield patch
353 353
354 @property 354 @property
355 def filenames(self): 355 def filenames(self):
356 return [p.filename for p in self.patches] 356 return [p.filename for p in self.patches]
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698