From 44d5d7ba42d5d595b58a1f7767d50570d4ae5791 Mon Sep 17 00:00:00 2001 From: Henrik Kjellander Date: Fri, 25 Sep 2015 13:21:44 +0200 Subject: [PATCH] Autoroll: Update checkout before reading chromium_revision. Ensure the checkout is updated _before_ reading the current revision from the DEPS file. This will avoid errors when a checkout is not up to date, as updating happened after reading the revision before this change. BUG=webrtc:4688 R=phoglund@webrtc.org Review URL: https://codereview.webrtc.org/1361923004 . Cr-Commit-Position: refs/heads/master@{#10071} --- tools/autoroller/roll_chromium_revision.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/autoroller/roll_chromium_revision.py b/tools/autoroller/roll_chromium_revision.py index e906809624..4f2de2f7e9 100755 --- a/tools/autoroller/roll_chromium_revision.py +++ b/tools/autoroller/roll_chromium_revision.py @@ -297,7 +297,8 @@ def _IsTreeClean(): logging.error('Dirty/unversioned files:\n%s', stdout) return False -def _CreateRollBranch(dry_run): + +def _EnsureUpdatedMasterBranch(dry_run): current_branch = _RunCommand( ['git', 'rev-parse', '--abbrev-ref', 'HEAD'])[0].splitlines()[0] if current_branch != 'master': @@ -308,6 +309,9 @@ def _CreateRollBranch(dry_run): logging.info('Updating master branch...') if not dry_run: _RunCommand(['git', 'pull']) + + +def _CreateRollBranch(dry_run): logging.info('Creating roll branch: %s', ROLL_BRANCH_NAME) if not dry_run: _RunCommand(['git', 'checkout', '-b', ROLL_BRANCH_NAME]) @@ -372,6 +376,8 @@ def main(): if opts.clean: _RemovePreviousRollBranch(opts.dry_run) + _EnsureUpdatedMasterBranch(opts.dry_run) + if not opts.revision: lkgr_contents = ReadUrlContent(CHROMIUM_LKGR_URL) logging.info('No revision specified. Using LKGR: %s', lkgr_contents[0])