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

Unified Diff: tools/push-to-trunk/common_includes.py

Issue 70373002: Add initial auto-roll script. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review. Created 7 years, 1 month 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 | « tools/push-to-trunk/auto_roll.py ('k') | tools/push-to-trunk/push_to_trunk.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/push-to-trunk/common_includes.py
diff --git a/tools/push-to-trunk/common_includes.py b/tools/push-to-trunk/common_includes.py
index 669aa6be1f4362d8113b73af86e8057d8f6cb134..06b7ebe53a3c3655e41048c186bef308b59402c0 100644
--- a/tools/push-to-trunk/common_includes.py
+++ b/tools/push-to-trunk/common_includes.py
@@ -244,8 +244,10 @@ class Step(object):
if self.Git("svn fetch") is None:
self.Die("'git svn fetch' failed.")
+ def PrepareBranch(self):
# Get ahold of a safe temporary branch and check it out.
- if current_branch != self._config[TEMP_BRANCH]:
+ self.RestoreIfUnset("current_branch")
+ if self._state["current_branch"] != self._config[TEMP_BRANCH]:
self.DeleteBranch(self._config[TEMP_BRANCH])
self.Git("checkout -b %s" % self._config[TEMP_BRANCH])
@@ -323,3 +325,26 @@ class UploadStep(Step):
args = "cl upload -r \"%s\" --send-mail" % reviewer
if self.Git(args,pipe=False) is None:
self.Die("'git cl upload' failed, please try again.")
+
+
+def RunScript(step_classes,
+ config,
+ options,
+ side_effect_handler=DEFAULT_SIDE_EFFECT_HANDLER):
+ state = {}
+ steps = []
+ number = 0
+
+ for step_class in step_classes:
+ # TODO(machenbach): Factory methods.
+ step = step_class()
+ step.SetNumber(number)
+ step.SetConfig(config)
+ step.SetOptions(options)
+ step.SetState(state)
+ step.SetSideEffectHandler(side_effect_handler)
+ steps.append(step)
+ number += 1
+
+ for step in steps[options.s:]:
+ step.Run()
« no previous file with comments | « tools/push-to-trunk/auto_roll.py ('k') | tools/push-to-trunk/push_to_trunk.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698