| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2013 the V8 project authors. All rights reserved. | 2 # Copyright 2013 the V8 project authors. All rights reserved. |
| 3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
| 4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
| 5 # met: | 5 # met: |
| 6 # | 6 # |
| 7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
| 8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
| 9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
| 10 # copyright notice, this list of conditions and the following | 10 # copyright notice, this list of conditions and the following |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 | 223 |
| 224 | 224 |
| 225 class GitFailedException(Exception): | 225 class GitFailedException(Exception): |
| 226 pass | 226 pass |
| 227 | 227 |
| 228 | 228 |
| 229 class CommonOptions(object): | 229 class CommonOptions(object): |
| 230 def __init__(self, options, manual=True): | 230 def __init__(self, options, manual=True): |
| 231 self.requires_editor = True | 231 self.requires_editor = True |
| 232 self.wait_for_lgtm = True | 232 self.wait_for_lgtm = True |
| 233 self.s = options.s | 233 self.step = options.step |
| 234 self.force_readline_defaults = not manual | 234 self.force_readline_defaults = not manual |
| 235 self.force_upload = not manual | 235 self.force_upload = not manual |
| 236 self.manual = manual | 236 self.manual = manual |
| 237 self.reviewer = getattr(options, 'reviewer', "") | 237 self.reviewer = getattr(options, 'reviewer', "") |
| 238 self.author = getattr(options, 'a', "") | 238 self.author = getattr(options, 'author', "") |
| 239 | 239 |
| 240 | 240 |
| 241 class Step(GitRecipesMixin): | 241 class Step(GitRecipesMixin): |
| 242 def __init__(self, text, requires, number, config, state, options, handler): | 242 def __init__(self, text, requires, number, config, state, options, handler): |
| 243 self._text = text | 243 self._text = text |
| 244 self._requires = requires | 244 self._requires = requires |
| 245 self._number = number | 245 self._number = number |
| 246 self._config = config | 246 self._config = config |
| 247 self._state = state | 247 self._state = state |
| 248 self._options = options | 248 self._options = options |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 500 return step_class(message, requires, number=number, config=config, | 500 return step_class(message, requires, number=number, config=config, |
| 501 state=state, options=options, | 501 state=state, options=options, |
| 502 handler=side_effect_handler) | 502 handler=side_effect_handler) |
| 503 | 503 |
| 504 | 504 |
| 505 def RunScript(step_classes, | 505 def RunScript(step_classes, |
| 506 config, | 506 config, |
| 507 options, | 507 options, |
| 508 side_effect_handler=DEFAULT_SIDE_EFFECT_HANDLER): | 508 side_effect_handler=DEFAULT_SIDE_EFFECT_HANDLER): |
| 509 state_file = "%s-state.json" % config[PERSISTFILE_BASENAME] | 509 state_file = "%s-state.json" % config[PERSISTFILE_BASENAME] |
| 510 if options.s == 0 and os.path.exists(state_file): | 510 if options.step == 0 and os.path.exists(state_file): |
| 511 os.remove(state_file) | 511 os.remove(state_file) |
| 512 state = {} | 512 state = {} |
| 513 steps = [] | 513 steps = [] |
| 514 for (number, step_class) in enumerate(step_classes): | 514 for (number, step_class) in enumerate(step_classes): |
| 515 steps.append(MakeStep(step_class, number, state, config, | 515 steps.append(MakeStep(step_class, number, state, config, |
| 516 options, side_effect_handler)) | 516 options, side_effect_handler)) |
| 517 | 517 |
| 518 for step in steps[options.s:]: | 518 for step in steps[options.step:]: |
| 519 step.Run() | 519 step.Run() |
| OLD | NEW |