Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(159)

Side by Side Diff: checkout.py

Issue 196573041: Remove force push from GitCheckout.commit() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698