Chromium Code Reviews| 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 695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 706 raise PatchApplicationFailed( | 706 raise PatchApplicationFailed( |
| 707 p, | 707 p, |
| 708 'While running %s;\n%s%s' % ( | 708 'While running %s;\n%s%s' % ( |
| 709 ' '.join(e.cmd), | 709 ' '.join(e.cmd), |
| 710 align_stdout(stdout), | 710 align_stdout(stdout), |
| 711 align_stdout([getattr(e, 'stdout', '')]))) | 711 align_stdout([getattr(e, 'stdout', '')]))) |
| 712 # Once all the patches are processed and added to the index, commit the | 712 # Once all the patches are processed and added to the index, commit the |
| 713 # index. | 713 # index. |
| 714 cmd = ['commit', '-m', 'Committed patch'] | 714 cmd = ['commit', '-m', 'Committed patch'] |
| 715 if name and email: | 715 if name and email: |
| 716 author = '%s <%s>' % (name, email) | 716 self._check_call_git(['config', 'user.email', email]) |
|
agable
2014/02/22 01:18:09
Ewwwwwwww. Use
git -c user.email=Foo user.name=Ba
Ryan Tseng
2014/02/22 01:47:16
Done.
| |
| 717 cmd.extend(['--author', author]) | 717 self._check_call_git(['config', 'user.name', name]) |
| 718 if verbose: | 718 if verbose: |
| 719 cmd.append('--verbose') | 719 cmd.append('--verbose') |
| 720 self._check_call_git(cmd) | 720 self._check_call_git(cmd) |
| 721 if name and email: | |
| 722 self._check_call_git(['config', '--unset', 'user.email', email]) | |
| 723 self._check_call_git(['config', '--unset', 'user.name', name]) | |
| 721 if self.base_ref: | 724 if self.base_ref: |
| 722 base_ref = self.base_ref | 725 base_ref = self.base_ref |
| 723 else: | 726 else: |
| 724 base_ref = '%s/%s' % (self.remote, | 727 base_ref = '%s/%s' % (self.remote, |
| 725 self.remote_branch or self.master_branch) | 728 self.remote_branch or self.master_branch) |
| 726 found_files = self._check_output_git( | 729 found_files = self._check_output_git( |
| 727 ['diff', base_ref, | 730 ['diff', base_ref, |
| 728 '--name-only']).splitlines(False) | 731 '--name-only']).splitlines(False) |
| 729 assert sorted(patches.filenames) == sorted(found_files), ( | 732 assert sorted(patches.filenames) == sorted(found_files), ( |
| 730 sorted(patches.filenames), sorted(found_files)) | 733 sorted(patches.filenames), sorted(found_files)) |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 838 def revisions(self, rev1, rev2): | 841 def revisions(self, rev1, rev2): |
| 839 return self.checkout.revisions(rev1, rev2) | 842 return self.checkout.revisions(rev1, rev2) |
| 840 | 843 |
| 841 @property | 844 @property |
| 842 def project_name(self): | 845 def project_name(self): |
| 843 return self.checkout.project_name | 846 return self.checkout.project_name |
| 844 | 847 |
| 845 @property | 848 @property |
| 846 def project_path(self): | 849 def project_path(self): |
| 847 return self.checkout.project_path | 850 return self.checkout.project_path |
| OLD | NEW |