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 39b68913426e3f845953434134339d6bd2e40d7c..4fd1aafa1de14d38f719db607bdf63668ccfdc54 100644 |
--- a/tools/push-to-trunk/common_includes.py |
+++ b/tools/push-to-trunk/common_includes.py |
@@ -256,11 +256,12 @@ class Step(GitRecipesMixin): |
if self._requires and not self._state.get(self._requires): |
return |
- print ">>> Step %d: %s" % (self._number, self._text) |
- self.RunStep() |
- |
- # Persist state. |
- TextToFile(json.dumps(self._state), state_file) |
+ try: |
+ print ">>> Step %d: %s" % (self._number, self._text) |
Jarin
2014/04/02 06:30:40
Why is the printing inside the try block? Can it f
|
+ return self.RunStep() |
+ finally: |
+ # Persist state. |
+ TextToFile(json.dumps(self._state), state_file) |
def RunStep(self): # pragma: no cover |
raise NotImplementedError |
@@ -555,7 +556,8 @@ class ScriptsBase(object): |
steps.append(MakeStep(step_class, number, self._state, self._config, |
options, self._side_effect_handler)) |
for step in steps[options.step:]: |
- step.Run() |
+ if step.Run(): |
+ return 1 |
return 0 |
def Run(self, args=None): |