cros_mark_as_stable: make it work better in repo

Instead of using master, use the tracking branch.

BUG=5258
TEST=Verified that cleanup now works with repo.

Change-Id: I6e415d9068d54b602238b89c77ba4dbe2f9ff4c6

Review URL: http://codereview.chromium.org/3076035
This commit is contained in:
Mandeep Singh Baines 2010-08-05 11:01:36 -07:00
parent 92e674967d
commit 642382095d

View File

@ -91,10 +91,8 @@ def _CheckSaneArguments(package_list, commit_id_list, command):
def _Clean():
"""Cleans up uncommitted changes on either stabilizing branch or master."""
if _CheckOnStabilizingBranch():
_RunCommand('git reset HEAD --hard')
_RunCommand('git checkout master')
_RunCommand('git reset HEAD --hard')
_RunCommand('git checkout %s' % gflags.FLAGS.tracking_branch)
def _PrintUsageAndDie(error_message=''):
@ -179,7 +177,7 @@ class _GitBranch(object):
Returns True on success.
"""
self._Checkout('master', create=False)
self._Checkout(gflags.FLAGS.tracking_branch, create=False)
delete_cmd = 'git branch -D %s' % self.branch_name
_RunCommand(delete_cmd)