| 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 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 742 # from the email and call it the original author's name. | 742 # from the email and call it the original author's name. |
| 743 # TODO(rmistry): Do not need the below if user is already in | 743 # TODO(rmistry): Do not need the below if user is already in |
| 744 # "Name <email>" format. | 744 # "Name <email>" format. |
| 745 name = user.split('@')[0] | 745 name = user.split('@')[0] |
| 746 commit_cmd.extend(['--author', '%s <%s>' % (name, user)]) | 746 commit_cmd.extend(['--author', '%s <%s>' % (name, user)]) |
| 747 self._check_call_git(commit_cmd) | 747 self._check_call_git(commit_cmd) |
| 748 | 748 |
| 749 # Push to the remote repository. | 749 # Push to the remote repository. |
| 750 self._check_call_git( | 750 self._check_call_git( |
| 751 ['push', 'origin', '%s:%s' % (self.working_branch, self.remote_branch), | 751 ['push', 'origin', '%s:%s' % (self.working_branch, self.remote_branch), |
| 752 '--force', '--quiet']) | 752 '--quiet']) |
| 753 # Get the revision after the push. | 753 # Get the revision after the push. |
| 754 revision = self._get_head_commit_hash() | 754 revision = self._get_head_commit_hash() |
| 755 # Switch back to the remote_branch and sync it. | 755 # Switch back to the remote_branch and sync it. |
| 756 self._check_call_git(['checkout', self.remote_branch]) | 756 self._check_call_git(['checkout', self.remote_branch]) |
| 757 self._sync_remote_branch() | 757 self._sync_remote_branch() |
| 758 # Delete the working branch since we are done with it. | 758 # Delete the working branch since we are done with it. |
| 759 self._check_call_git(['branch', '-D', self.working_branch]) | 759 self._check_call_git(['branch', '-D', self.working_branch]) |
| 760 | 760 |
| 761 return revision | 761 return revision |
| 762 | 762 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 837 def revisions(self, rev1, rev2): | 837 def revisions(self, rev1, rev2): |
| 838 return self.checkout.revisions(rev1, rev2) | 838 return self.checkout.revisions(rev1, rev2) |
| 839 | 839 |
| 840 @property | 840 @property |
| 841 def project_name(self): | 841 def project_name(self): |
| 842 return self.checkout.project_name | 842 return self.checkout.project_name |
| 843 | 843 |
| 844 @property | 844 @property |
| 845 def project_path(self): | 845 def project_path(self): |
| 846 return self.checkout.project_path | 846 return self.checkout.project_path |
| OLD | NEW |