cros_mark_as_stable: use git push instead of git-cl push

Using git-cl push requires setting up Rietveld authentication
cookies on the bots. This is non-trivial. So instead just use
git. This removes a point of failure.

BUG=5258
TEST=Verified by successfully pushing.

Change-Id: Ic3cd68f2d2a9cc59bbe69270896172ee4a418226

Review URL: http://codereview.chromium.org/3015061
This commit is contained in:
Mandeep Singh Baines 2010-08-06 10:14:03 -07:00
parent 0d5f948934
commit 91a5215c0b

View File

@ -128,11 +128,22 @@ def _PushChange():
if not _CheckOnStabilizingBranch(): if not _CheckOnStabilizingBranch():
generate_test_report.Die('Expected %s to be on branch "%s"' % generate_test_report.Die('Expected %s to be on branch "%s"' %
(os.getcwd(), _STABLE_BRANCH_NAME)) (os.getcwd(), _STABLE_BRANCH_NAME))
_RunCommand('git cl upload --desc_from_logs -m "%s"' % description = _RunCommand('git log --format=format:%s%n%n%b ' +
'Marking set of ebuilds as stable') gflags.FLAGS.tracking_branch + '..')
description = 'Marking set of ebuilds as stable\n\n%s' % description
merge_branch_name = 'merge_branch'
_RunCommand('git remote update') _RunCommand('git remote update')
_RunCommand('git rebase %s' % gflags.FLAGS.tracking_branch) _RunCommand('git checkout -b %s %s' % (
_RunCommand('git cl push %s' % gflags.FLAGS.push_options) merge_branch_name, gflags.FLAGS.tracking_branch))
try:
_RunCommand('git merge --squash %s' % _STABLE_BRANCH_NAME)
_RunCommand('git commit -m "%s"' % description)
# Ugh. There has got to be an easier way to push to a tracking branch
_RunCommand('git config push.default tracking')
_RunCommand('git push')
finally:
_RunCommand('git checkout %s' % _STABLE_BRANCH_NAME)
_RunCommand('git branch -D %s' % merge_branch_name)
def _RunCommand(command): def _RunCommand(command):