From 91a5215c0bcd9a908d3f9fd5ff02866afa0d1fe2 Mon Sep 17 00:00:00 2001 From: Mandeep Singh Baines Date: Fri, 6 Aug 2010 10:14:03 -0700 Subject: [PATCH] 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 --- cros_mark_as_stable.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/cros_mark_as_stable.py b/cros_mark_as_stable.py index 3af5df8890..6daf9bb697 100755 --- a/cros_mark_as_stable.py +++ b/cros_mark_as_stable.py @@ -128,11 +128,22 @@ def _PushChange(): if not _CheckOnStabilizingBranch(): generate_test_report.Die('Expected %s to be on branch "%s"' % (os.getcwd(), _STABLE_BRANCH_NAME)) - _RunCommand('git cl upload --desc_from_logs -m "%s"' % - 'Marking set of ebuilds as stable') + description = _RunCommand('git log --format=format:%s%n%n%b ' + + 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 rebase %s' % gflags.FLAGS.tracking_branch) - _RunCommand('git cl push %s' % gflags.FLAGS.push_options) + _RunCommand('git checkout -b %s %s' % ( + 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):