| 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 print "ToT (r%d) is clean. Pushing to trunk." % latest | 135 print "ToT (r%d) is clean. Pushing to trunk." % latest |
| 136 self.PushTreeStatus("Tree is closed (preparing to push)") | 136 self.PushTreeStatus("Tree is closed (preparing to push)") |
| 137 | 137 |
| 138 # TODO(machenbach): Update the script before calling it. | 138 # TODO(machenbach): Update the script before calling it. |
| 139 try: | 139 try: |
| 140 if self._options.push: | 140 if self._options.push: |
| 141 P = push_to_trunk.PushToTrunk | 141 P = push_to_trunk.PushToTrunk |
| 142 self._side_effect_handler.Call( | 142 self._side_effect_handler.Call( |
| 143 P(push_to_trunk.CONFIG, self._side_effect_handler).Run, | 143 P(push_to_trunk.CONFIG, self._side_effect_handler).Run, |
| 144 ["-a", self._options.author, | 144 ["-a", self._options.author, |
| 145 "-c", self._options.chromium, | |
| 146 "-r", self._options.reviewer, | 145 "-r", self._options.reviewer, |
| 147 "-f"]) | 146 "-f"]) |
| 148 finally: | 147 finally: |
| 149 self.PushTreeStatus(self["tree_message"]) | 148 self.PushTreeStatus(self["tree_message"]) |
| 150 else: | 149 else: |
| 151 print("ToT (r%d) is ahead of the LKGR (r%d). Skipping push to trunk." | 150 print("ToT (r%d) is ahead of the LKGR (r%d). Skipping push to trunk." |
| 152 % (latest, lkgr)) | 151 % (latest, lkgr)) |
| 153 | 152 |
| 154 | 153 |
| 155 class AutoRoll(ScriptsBase): | 154 class AutoRoll(ScriptsBase): |
| 156 def _PrepareOptions(self, parser): | 155 def _PrepareOptions(self, parser): |
| 157 parser.add_argument("-c", "--chromium", required=True, | 156 parser.add_argument("-c", "--chromium", |
| 158 help=("The path to your Chromium src/ " | 157 help=("Deprecated.")) |
| 159 "directory to automate the V8 roll.")) | |
| 160 parser.add_argument("-p", "--push", | 158 parser.add_argument("-p", "--push", |
| 161 help="Push to trunk. Dry run if unspecified.", | 159 help="Push to trunk. Dry run if unspecified.", |
| 162 default=False, action="store_true") | 160 default=False, action="store_true") |
| 163 parser.add_argument("--status-password", | 161 parser.add_argument("--status-password", |
| 164 help="A file with the password to the status app.") | 162 help="A file with the password to the status app.") |
| 165 | 163 |
| 166 def _ProcessOptions(self, options): | 164 def _ProcessOptions(self, options): |
| 167 if not options.author or not options.reviewer: # pragma: no cover | 165 if not options.author or not options.reviewer: # pragma: no cover |
| 168 print "You need to specify author and reviewer." | 166 print "You need to specify author and reviewer." |
| 169 return False | 167 return False |
| 170 options.requires_editor = False | 168 options.requires_editor = False |
| 171 return True | 169 return True |
| 172 | 170 |
| 173 def _Steps(self): | 171 def _Steps(self): |
| 174 return [ | 172 return [ |
| 175 Preparation, | 173 Preparation, |
| 176 CheckAutoRollSettings, | 174 CheckAutoRollSettings, |
| 177 CheckTreeStatus, | 175 CheckTreeStatus, |
| 178 FetchLatestRevision, | 176 FetchLatestRevision, |
| 179 CheckLastPush, | 177 CheckLastPush, |
| 180 FetchLKGR, | 178 FetchLKGR, |
| 181 PushToTrunk, | 179 PushToTrunk, |
| 182 ] | 180 ] |
| 183 | 181 |
| 184 | 182 |
| 185 if __name__ == "__main__": # pragma: no cover | 183 if __name__ == "__main__": # pragma: no cover |
| 186 sys.exit(AutoRoll(CONFIG).Run()) | 184 sys.exit(AutoRoll(CONFIG).Run()) |
| OLD | NEW |