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

Unified Diff: checkout.py

Issue 280023004: Don't have checkout.py's git apply_patch fail when files don't match (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: checkout.py
diff --git a/checkout.py b/checkout.py
index 68781cb4c78ba61655c271bddafebc5af127541c..15d548cdb6ee8004ad0ba47e0dbcb2efd006f63c 100644
--- a/checkout.py
+++ b/checkout.py
@@ -707,10 +707,14 @@ class GitCheckout(CheckoutBase):
found_files = self._check_output_git(
['diff', '--ignore-submodules',
'--name-only', '--staged']).splitlines(False)
- assert sorted(patches.filenames) == sorted(found_files), (
- 'Found extra %s locally, %s not patched' % (
- sorted(set(found_files) - set(patches.filenames)),
- sorted(set(patches.filenames) - set(found_files))))
+ if sorted(patches.filenames) != sorted(found_files):
+ extra_files = sorted(set(found_files) - set(patches.filenames))
+ unpatched_files = sorted(set(patches.filenames) - set(found_files))
+ if extra_files:
+ print 'Found extra files: %r' % (extra_files,)
M-A Ruel 2014/05/12 12:35:55 I disagree that checkout.py should ever "print" at
+ if unpatched_files:
+ print 'Found unpatched files: %r' % (unpatched_files,)
+
M-A Ruel 2014/05/12 12:35:55 One superfluous line.
def commit(self, commit_message, user):
"""Commits, updates the commit message and pushes."""
« 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