| 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 cmd = ['-c', 'user.email=%s' % email, '-c', 'user.name=%s' % name] + cmd |
| 717 cmd.extend(['--author', author]) | |
| 718 if verbose: | 717 if verbose: |
| 719 cmd.append('--verbose') | 718 cmd.append('--verbose') |
| 720 self._check_call_git(cmd) | 719 self._check_call_git(cmd) |
| 721 if self.base_ref: | 720 if self.base_ref: |
| 722 base_ref = self.base_ref | 721 base_ref = self.base_ref |
| 723 else: | 722 else: |
| 724 base_ref = '%s/%s' % (self.remote, | 723 base_ref = '%s/%s' % (self.remote, |
| 725 self.remote_branch or self.master_branch) | 724 self.remote_branch or self.master_branch) |
| 726 found_files = self._check_output_git( | 725 found_files = self._check_output_git( |
| 727 ['diff', base_ref, | 726 ['diff', base_ref, |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 838 def revisions(self, rev1, rev2): | 837 def revisions(self, rev1, rev2): |
| 839 return self.checkout.revisions(rev1, rev2) | 838 return self.checkout.revisions(rev1, rev2) |
| 840 | 839 |
| 841 @property | 840 @property |
| 842 def project_name(self): | 841 def project_name(self): |
| 843 return self.checkout.project_name | 842 return self.checkout.project_name |
| 844 | 843 |
| 845 @property | 844 @property |
| 846 def project_path(self): | 845 def project_path(self): |
| 847 return self.checkout.project_path | 846 return self.checkout.project_path |
| OLD | NEW |