| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2014 the V8 project authors. All rights reserved. | 2 # Copyright 2014 the V8 project authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 import argparse | 6 import argparse |
| 7 import json | 7 import json |
| 8 import os | 8 import os |
| 9 import sys | 9 import sys |
| 10 import urllib | 10 import urllib |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 print("There is no newer v8 revision than the one in Chromium (%s)." | 63 print("There is no newer v8 revision than the one in Chromium (%s)." |
| 64 % last_roll) | 64 % last_roll) |
| 65 return True | 65 return True |
| 66 | 66 |
| 67 | 67 |
| 68 class RollChromium(Step): | 68 class RollChromium(Step): |
| 69 MESSAGE = "Roll V8 into Chromium." | 69 MESSAGE = "Roll V8 into Chromium." |
| 70 | 70 |
| 71 def RunStep(self): | 71 def RunStep(self): |
| 72 if self._options.roll: | 72 if self._options.roll: |
| 73 args = [ |
| 74 "--author", self._options.author, |
| 75 "--reviewer", self._options.reviewer, |
| 76 "--chromium", self._options.chromium, |
| 77 "--force", |
| 78 ] |
| 79 if self._options.sheriff: |
| 80 args.extend([ |
| 81 "--sheriff", "--googlers-mapping", self._options.googlers_mapping]) |
| 73 R = chromium_roll.ChromiumRoll | 82 R = chromium_roll.ChromiumRoll |
| 74 self._side_effect_handler.Call( | 83 self._side_effect_handler.Call( |
| 75 R(chromium_roll.CONFIG, self._side_effect_handler).Run, | 84 R(chromium_roll.CONFIG, self._side_effect_handler).Run, |
| 76 ["--author", self._options.author, | 85 args) |
| 77 "--reviewer", self._options.reviewer, | |
| 78 "--chromium", self._options.chromium, | |
| 79 "--force"]) | |
| 80 | 86 |
| 81 | 87 |
| 82 class AutoRoll(ScriptsBase): | 88 class AutoRoll(ScriptsBase): |
| 83 def _PrepareOptions(self, parser): | 89 def _PrepareOptions(self, parser): |
| 84 group = parser.add_mutually_exclusive_group() | |
| 85 parser.add_argument("-c", "--chromium", required=True, | 90 parser.add_argument("-c", "--chromium", required=True, |
| 86 help=("The path to your Chromium src/ " | 91 help=("The path to your Chromium src/ " |
| 87 "directory to automate the V8 roll.")) | 92 "directory to automate the V8 roll.")) |
| 88 parser.add_argument("--roll", | 93 parser.add_argument("--roll", |
| 89 help="Make Chromium roll. Dry run if unspecified.", | 94 help="Make Chromium roll. Dry run if unspecified.", |
| 90 default=False, action="store_true") | 95 default=False, action="store_true") |
| 91 | 96 |
| 92 def _ProcessOptions(self, options): # pragma: no cover | 97 def _ProcessOptions(self, options): # pragma: no cover |
| 93 if not options.reviewer: | 98 if not options.reviewer: |
| 94 print "A reviewer (-r) is required." | 99 print "A reviewer (-r) is required." |
| 95 return False | 100 return False |
| 96 if not options.author: | 101 if not options.author: |
| 97 print "An author (-a) is required." | 102 print "An author (-a) is required." |
| 98 return False | 103 return False |
| 99 return True | 104 return True |
| 100 | 105 |
| 101 def _Steps(self): | 106 def _Steps(self): |
| 102 return [ | 107 return [ |
| 103 CheckActiveRoll, | 108 CheckActiveRoll, |
| 104 DetectLastPush, | 109 DetectLastPush, |
| 105 DetectLastRoll, | 110 DetectLastRoll, |
| 106 RollChromium, | 111 RollChromium, |
| 107 ] | 112 ] |
| 108 | 113 |
| 109 | 114 |
| 110 if __name__ == "__main__": # pragma: no cover | 115 if __name__ == "__main__": # pragma: no cover |
| 111 sys.exit(AutoRoll(CONFIG).Run()) | 116 sys.exit(AutoRoll(CONFIG).Run()) |
| OLD | NEW |