| 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 708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 719 self._check_call_git(cmd) | 719 self._check_call_git(cmd) |
| 720 if self.base_ref: | 720 if self.base_ref: |
| 721 base_ref = self.base_ref | 721 base_ref = self.base_ref |
| 722 else: | 722 else: |
| 723 base_ref = '%s/%s' % (self.remote, | 723 base_ref = '%s/%s' % (self.remote, |
| 724 self.remote_branch or self.master_branch) | 724 self.remote_branch or self.master_branch) |
| 725 found_files = self._check_output_git( | 725 found_files = self._check_output_git( |
| 726 ['diff', base_ref, '--ignore-submodules', | 726 ['diff', base_ref, '--ignore-submodules', |
| 727 '--name-only']).splitlines(False) | 727 '--name-only']).splitlines(False) |
| 728 assert sorted(patches.filenames) == sorted(found_files), ( | 728 assert sorted(patches.filenames) == sorted(found_files), ( |
| 729 sorted(patches.filenames), sorted(found_files)) | 729 'Found extra %s locally, %s not patched' % ( |
| 730 sorted(set(found_files) - set(patches.filenames)), |
| 731 sorted(set(patches.filenames) - set(found_files)))) |
| 730 | 732 |
| 731 def commit(self, commit_message, user): | 733 def commit(self, commit_message, user): |
| 732 """Commits, updates the commit message and pushes.""" | 734 """Commits, updates the commit message and pushes.""" |
| 733 assert self.commit_user | 735 assert self.commit_user |
| 734 assert isinstance(commit_message, unicode) | 736 assert isinstance(commit_message, unicode) |
| 735 current_branch = self._check_output_git( | 737 current_branch = self._check_output_git( |
| 736 ['rev-parse', '--abbrev-ref', 'HEAD']).strip() | 738 ['rev-parse', '--abbrev-ref', 'HEAD']).strip() |
| 737 assert current_branch == self.working_branch | 739 assert current_branch == self.working_branch |
| 738 | 740 |
| 739 commit_cmd = ['commit', '--amend', '-m', commit_message] | 741 commit_cmd = ['commit', '--amend', '-m', commit_message] |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 837 def revisions(self, rev1, rev2): | 839 def revisions(self, rev1, rev2): |
| 838 return self.checkout.revisions(rev1, rev2) | 840 return self.checkout.revisions(rev1, rev2) |
| 839 | 841 |
| 840 @property | 842 @property |
| 841 def project_name(self): | 843 def project_name(self): |
| 842 return self.checkout.project_name | 844 return self.checkout.project_name |
| 843 | 845 |
| 844 @property | 846 @property |
| 845 def project_path(self): | 847 def project_path(self): |
| 846 return self.checkout.project_path | 848 return self.checkout.project_path |
| OLD | NEW |