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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 if self._options.roll: | 93 if self._options.roll: |
94 args = [ | 94 args = [ |
95 "--author", self._options.author, | 95 "--author", self._options.author, |
96 "--reviewer", self._options.reviewer, | 96 "--reviewer", self._options.reviewer, |
97 "--chromium", self._options.chromium, | 97 "--chromium", self._options.chromium, |
98 "--use-commit-queue", | 98 "--use-commit-queue", |
99 ] | 99 ] |
100 if self._options.sheriff: | 100 if self._options.sheriff: |
101 args.extend([ | 101 args.extend([ |
102 "--sheriff", "--googlers-mapping", self._options.googlers_mapping]) | 102 "--sheriff", "--googlers-mapping", self._options.googlers_mapping]) |
| 103 if self._options.dry_run: |
| 104 args.extend(["--dry-run"]) |
103 R = chromium_roll.ChromiumRoll | 105 R = chromium_roll.ChromiumRoll |
104 self._side_effect_handler.Call( | 106 self._side_effect_handler.Call( |
105 R(chromium_roll.CONFIG, self._side_effect_handler).Run, | 107 R(chromium_roll.CONFIG, self._side_effect_handler).Run, |
106 args) | 108 args) |
107 | 109 |
108 | 110 |
109 class AutoRoll(ScriptsBase): | 111 class AutoRoll(ScriptsBase): |
110 def _PrepareOptions(self, parser): | 112 def _PrepareOptions(self, parser): |
111 parser.add_argument("-c", "--chromium", required=True, | 113 parser.add_argument("-c", "--chromium", required=True, |
112 help=("The path to your Chromium src/ " | 114 help=("The path to your Chromium src/ " |
113 "directory to automate the V8 roll.")) | 115 "directory to automate the V8 roll.")) |
114 parser.add_argument("--roll", | 116 parser.add_argument("--roll", help="Call Chromium roll script.", |
115 help="Make Chromium roll. Dry run if unspecified.", | |
116 default=False, action="store_true") | 117 default=False, action="store_true") |
117 | 118 |
118 def _ProcessOptions(self, options): # pragma: no cover | 119 def _ProcessOptions(self, options): # pragma: no cover |
119 if not options.reviewer: | 120 if not options.reviewer: |
120 print "A reviewer (-r) is required." | 121 print "A reviewer (-r) is required." |
121 return False | 122 return False |
122 if not options.author: | 123 if not options.author: |
123 print "An author (-a) is required." | 124 print "An author (-a) is required." |
124 return False | 125 return False |
125 return True | 126 return True |
126 | 127 |
127 def _Steps(self): | 128 def _Steps(self): |
128 return [ | 129 return [ |
129 CheckActiveRoll, | 130 CheckActiveRoll, |
130 DetectLastPush, | 131 DetectLastPush, |
131 DetectLastRoll, | 132 DetectLastRoll, |
132 CheckClusterFuzz, | 133 CheckClusterFuzz, |
133 RollChromium, | 134 RollChromium, |
134 ] | 135 ] |
135 | 136 |
136 | 137 |
137 if __name__ == "__main__": # pragma: no cover | 138 if __name__ == "__main__": # pragma: no cover |
138 sys.exit(AutoRoll(CONFIG).Run()) | 139 sys.exit(AutoRoll(CONFIG).Run()) |
OLD | NEW |