| 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 16 matching lines...) Expand all Loading... |
| 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 28 | 28 |
| 29 import argparse | 29 import argparse |
| 30 import json | 30 import json |
| 31 import os | 31 import os |
| 32 import re | 32 import re |
| 33 import sys | 33 import sys |
| 34 import urllib | 34 import urllib |
| 35 | 35 |
| 36 from common_includes import * | 36 from common_includes import * |
| 37 import push_to_trunk | 37 import push_to_candidates |
| 38 | 38 |
| 39 PUSH_MESSAGE_RE = re.compile(r".* \(based on ([a-fA-F0-9]+)\)$") | 39 PUSH_MESSAGE_RE = re.compile(r".* \(based on ([a-fA-F0-9]+)\)$") |
| 40 | 40 |
| 41 class Preparation(Step): | 41 class Preparation(Step): |
| 42 MESSAGE = "Preparation." | 42 MESSAGE = "Preparation." |
| 43 | 43 |
| 44 def RunStep(self): | 44 def RunStep(self): |
| 45 self.InitialEnvironmentChecks(self.default_cwd) | 45 self.InitialEnvironmentChecks(self.default_cwd) |
| 46 self.CommonPrepare() | 46 self.CommonPrepare() |
| 47 | 47 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 "--revision", self["candidate"], | 86 "--revision", self["candidate"], |
| 87 "--force", | 87 "--force", |
| 88 ] | 88 ] |
| 89 | 89 |
| 90 if self._options.work_dir: | 90 if self._options.work_dir: |
| 91 args.extend(["--work-dir", self._options.work_dir]) | 91 args.extend(["--work-dir", self._options.work_dir]) |
| 92 | 92 |
| 93 # TODO(machenbach): Update the script before calling it. | 93 # TODO(machenbach): Update the script before calling it. |
| 94 if self._options.push: | 94 if self._options.push: |
| 95 self._side_effect_handler.Call( | 95 self._side_effect_handler.Call( |
| 96 push_to_trunk.PushToCandidates().Run, args) | 96 push_to_candidates.PushToCandidates().Run, args) |
| 97 | 97 |
| 98 | 98 |
| 99 class AutoPush(ScriptsBase): | 99 class AutoPush(ScriptsBase): |
| 100 def _PrepareOptions(self, parser): | 100 def _PrepareOptions(self, parser): |
| 101 parser.add_argument("-p", "--push", | 101 parser.add_argument("-p", "--push", |
| 102 help="Push to candidates. Dry run if unspecified.", | 102 help="Push to candidates. Dry run if unspecified.", |
| 103 default=False, action="store_true") | 103 default=False, action="store_true") |
| 104 | 104 |
| 105 def _ProcessOptions(self, options): | 105 def _ProcessOptions(self, options): |
| 106 if not options.author or not options.reviewer: # pragma: no cover | 106 if not options.author or not options.reviewer: # pragma: no cover |
| (...skipping 11 matching lines...) Expand all Loading... |
| 118 return [ | 118 return [ |
| 119 Preparation, | 119 Preparation, |
| 120 FetchCandidate, | 120 FetchCandidate, |
| 121 CheckLastPush, | 121 CheckLastPush, |
| 122 PushToCandidates, | 122 PushToCandidates, |
| 123 ] | 123 ] |
| 124 | 124 |
| 125 | 125 |
| 126 if __name__ == "__main__": # pragma: no cover | 126 if __name__ == "__main__": # pragma: no cover |
| 127 sys.exit(AutoPush().Run()) | 127 sys.exit(AutoPush().Run()) |
| OLD | NEW |