From 665da2885737160eb402119893bcb0d0f249de5f Mon Sep 17 00:00:00 2001 From: kjellander Date: Wed, 14 Dec 2016 03:57:08 -0800 Subject: [PATCH] Autoroller: Add --ignore-unclean-workdir flag Add a flag that makes the script more useful for local development, when you normally develop on a local branch. BUG=webrtc:5006 NOTRY=True Review-Url: https://codereview.webrtc.org/2566223007 Cr-Commit-Position: refs/heads/master@{#15602} --- tools/autoroller/roll_chromium_revision.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/autoroller/roll_chromium_revision.py b/tools/autoroller/roll_chromium_revision.py index 787e3db7fb..85cbbe9d36 100755 --- a/tools/autoroller/roll_chromium_revision.py +++ b/tools/autoroller/roll_chromium_revision.py @@ -449,6 +449,10 @@ def main(): help=('Calculate changes and modify DEPS, but don\'t create ' 'any local branch, commit, upload CL or send any ' 'tryjobs.')) + p.add_argument('-i', '--ignore-unclean-workdir', action='store_true', + default=False, + help=('Ignore if the current branch is not master or if there ' + 'are uncommitted changes (default: %(default)s).')) p.add_argument('--skip-cq', action='store_true', default=False, help='Skip sending the CL to the CQ (default: %(default)s)') p.add_argument('-v', '--verbose', action='store_true', default=False, @@ -460,14 +464,15 @@ def main(): else: logging.basicConfig(level=logging.INFO) - if not _IsTreeClean(): + if not opts.ignore_unclean_workdir and not _IsTreeClean(): logging.error('Please clean your local checkout first.') return 1 if opts.clean: _RemovePreviousRollBranch(opts.dry_run) - _EnsureUpdatedMasterBranch(opts.dry_run) + if not opts.ignore_unclean_workdir: + _EnsureUpdatedMasterBranch(opts.dry_run) new_cr_rev = opts.revision if not new_cr_rev: