OLD | NEW |
---|---|
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 Loading... | |
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 Loading... | |
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 |
OLD | NEW |