Index: tools/push-to-trunk/push_to_trunk.py |
diff --git a/tools/push-to-trunk/push_to_trunk.py b/tools/push-to-trunk/push_to_trunk.py |
index 04e992d72561d3bda315f9ec7cfc161f5b0fa25d..2aa32cd31911603907f4a8ef80148c4a45253cff 100755 |
--- a/tools/push-to-trunk/push_to_trunk.py |
+++ b/tools/push-to-trunk/push_to_trunk.py |
@@ -59,6 +59,7 @@ class Preparation(Step): |
def RunStep(self): |
self.InitialEnvironmentChecks() |
self.CommonPrepare() |
+ self.PrepareBranch() |
self.DeleteBranch(self.Config(TRUNKBRANCH)) |
@@ -487,9 +488,9 @@ class CleanUp(Step): |
self.Git("branch -D %s" % self.Config(TRUNKBRANCH)) |
-def RunScript(config, |
- options, |
- side_effect_handler=DEFAULT_SIDE_EFFECT_HANDLER): |
+def RunPushToTrunk(config, |
+ options, |
+ side_effect_handler=DEFAULT_SIDE_EFFECT_HANDLER): |
step_classes = [ |
Preparation, |
FreshBranch, |
@@ -517,23 +518,7 @@ def RunScript(config, |
CleanUp, |
] |
- 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() |
+ RunScript(step_classes, config, options, side_effect_handler) |
def BuildOptions(): |