Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(88)

Unified Diff: tools/autoroller/roll_chromium_revision.py

Issue 1173523003: Auto-roll script: Add dirty tree check and git pull (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Added treecheck and made pull not run in dry-run mode Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/autoroller/roll_chromium_revision.py
diff --git a/tools/autoroller/roll_chromium_revision.py b/tools/autoroller/roll_chromium_revision.py
index 57937ed82ee3e6042245524bd3271a9bd940b433..981f1aef79ec424e9d61490612010b7c019ca9c2 100755
--- a/tools/autoroller/roll_chromium_revision.py
+++ b/tools/autoroller/roll_chromium_revision.py
@@ -289,6 +289,13 @@ def UpdateDeps(deps_filename, old_cr_revision, new_cr_revision):
with open(deps_filename, 'wb') as deps_file:
deps_file.write(deps_content)
+def _IsTreeClean():
+ stdout, _ = _RunCommand(['git', 'status', '--porcelain'])
+ if len(stdout) == 0:
+ return True
+
+ logging.error('Dirty/unversioned files:\n%s', stdout)
+ return False
def _CreateRollBranch(dry_run):
current_branch = _RunCommand(
@@ -298,6 +305,9 @@ def _CreateRollBranch(dry_run):
if not dry_run:
sys.exit(-1)
+ logging.info('Updating master branch...')
+ if not dry_run:
+ _RunCommand(['git', 'pull'])
logging.info('Creating roll branch: %s', ROLL_BRANCH_NAME)
if not dry_run:
_RunCommand(['git', 'checkout', '-b', ROLL_BRANCH_NAME])
@@ -353,6 +363,10 @@ def main():
else:
logging.basicConfig(level=logging.INFO)
+ if not _IsTreeClean():
+ logging.error('Please clean your local checkout first.')
+ return 1
+
if opts.clean:
_RemovePreviousRollBranch(opts.dry_run)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698