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

Side by Side 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 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) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 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 """Manages a project checkout. 5 """Manages a project checkout.
6 6
7 Includes support for svn, git-svn and git. 7 Includes support for svn, git-svn and git.
8 """ 8 """
9 9
10 import ConfigParser 10 import ConfigParser
(...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 except subprocess.CalledProcessError, e: 700 except subprocess.CalledProcessError, e:
701 raise PatchApplicationFailed( 701 raise PatchApplicationFailed(
702 p, 702 p,
703 'While running %s;\n%s%s' % ( 703 'While running %s;\n%s%s' % (
704 ' '.join(e.cmd), 704 ' '.join(e.cmd),
705 align_stdout(stdout), 705 align_stdout(stdout),
706 align_stdout([getattr(e, 'stdout', '')]))) 706 align_stdout([getattr(e, 'stdout', '')])))
707 found_files = self._check_output_git( 707 found_files = self._check_output_git(
708 ['diff', '--ignore-submodules', 708 ['diff', '--ignore-submodules',
709 '--name-only', '--staged']).splitlines(False) 709 '--name-only', '--staged']).splitlines(False)
710 assert sorted(patches.filenames) == sorted(found_files), ( 710 if sorted(patches.filenames) != sorted(found_files):
711 'Found extra %s locally, %s not patched' % ( 711 extra_files = sorted(set(found_files) - set(patches.filenames))
712 sorted(set(found_files) - set(patches.filenames)), 712 unpatched_files = sorted(set(patches.filenames) - set(found_files))
713 sorted(set(patches.filenames) - set(found_files)))) 713 if extra_files:
714 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
715 if unpatched_files:
716 print 'Found unpatched files: %r' % (unpatched_files,)
717
714 718
M-A Ruel 2014/05/12 12:35:55 One superfluous line.
715 def commit(self, commit_message, user): 719 def commit(self, commit_message, user):
716 """Commits, updates the commit message and pushes.""" 720 """Commits, updates the commit message and pushes."""
717 # TODO(hinoka): CQ no longer uses this, I think its deprecated. 721 # TODO(hinoka): CQ no longer uses this, I think its deprecated.
718 # Delete this. 722 # Delete this.
719 assert self.commit_user 723 assert self.commit_user
720 assert isinstance(commit_message, unicode) 724 assert isinstance(commit_message, unicode)
721 current_branch = self._check_output_git( 725 current_branch = self._check_output_git(
722 ['rev-parse', '--abbrev-ref', 'HEAD']).strip() 726 ['rev-parse', '--abbrev-ref', 'HEAD']).strip()
723 assert current_branch == self.working_branch 727 assert current_branch == self.working_branch
724 728
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
822 def revisions(self, rev1, rev2): 826 def revisions(self, rev1, rev2):
823 return self.checkout.revisions(rev1, rev2) 827 return self.checkout.revisions(rev1, rev2)
824 828
825 @property 829 @property
826 def project_name(self): 830 def project_name(self):
827 return self.checkout.project_name 831 return self.checkout.project_name
828 832
829 @property 833 @property
830 def project_path(self): 834 def project_path(self):
831 return self.checkout.project_path 835 return self.checkout.project_path
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