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 sys | 7 import sys |
8 | 8 |
9 from common_includes import * | 9 from common_includes import * |
10 | 10 |
11 CONFIG = { | |
12 BRANCHNAME: "auto-tag-v8", | |
13 PERSISTFILE_BASENAME: "/tmp/v8-auto-tag-tempfile", | |
14 } | |
15 | |
16 | 11 |
17 class Preparation(Step): | 12 class Preparation(Step): |
18 MESSAGE = "Preparation." | 13 MESSAGE = "Preparation." |
19 | 14 |
20 def RunStep(self): | 15 def RunStep(self): |
21 self.CommonPrepare() | 16 self.CommonPrepare() |
22 self.PrepareBranch() | 17 self.PrepareBranch() |
23 self.GitCheckout("master") | 18 self.GitCheckout("master") |
24 self.GitSVNRebase() | 19 self.GitSVNRebase() |
25 | 20 |
26 | 21 |
27 class GetTags(Step): | 22 class GetTags(Step): |
28 MESSAGE = "Get all V8 tags." | 23 MESSAGE = "Get all V8 tags." |
29 | 24 |
30 def RunStep(self): | 25 def RunStep(self): |
31 self.GitCreateBranch(self._config[BRANCHNAME]) | 26 self.GitCreateBranch(self._config["BRANCHNAME"]) |
32 | 27 |
33 # Get remote tags. | 28 # Get remote tags. |
34 tags = filter(lambda s: re.match(r"^svn/tags/[\d+\.]+$", s), | 29 tags = filter(lambda s: re.match(r"^svn/tags/[\d+\.]+$", s), |
35 self.GitRemotes()) | 30 self.GitRemotes()) |
36 | 31 |
37 # Remove 'svn/tags/' prefix. | 32 # Remove 'svn/tags/' prefix. |
38 self["tags"] = map(lambda s: s[9:], tags) | 33 self["tags"] = map(lambda s: s[9:], tags) |
39 | 34 |
40 | 35 |
41 class GetOldestUntaggedVersion(Step): | 36 class GetOldestUntaggedVersion(Step): |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 | 170 |
176 def _ProcessOptions(self, options): # pragma: no cover | 171 def _ProcessOptions(self, options): # pragma: no cover |
177 if not options.dry_run and not options.author: | 172 if not options.dry_run and not options.author: |
178 print "Specify your chromium.org email with -a" | 173 print "Specify your chromium.org email with -a" |
179 return False | 174 return False |
180 options.wait_for_lgtm = False | 175 options.wait_for_lgtm = False |
181 options.force_readline_defaults = True | 176 options.force_readline_defaults = True |
182 options.force_upload = True | 177 options.force_upload = True |
183 return True | 178 return True |
184 | 179 |
| 180 def _Config(self): |
| 181 return { |
| 182 "BRANCHNAME": "auto-tag-v8", |
| 183 "PERSISTFILE_BASENAME": "/tmp/v8-auto-tag-tempfile", |
| 184 } |
| 185 |
185 def _Steps(self): | 186 def _Steps(self): |
186 return [ | 187 return [ |
187 Preparation, | 188 Preparation, |
188 GetTags, | 189 GetTags, |
189 GetOldestUntaggedVersion, | 190 GetOldestUntaggedVersion, |
190 GetLKGRs, | 191 GetLKGRs, |
191 CalculateTagRevision, | 192 CalculateTagRevision, |
192 MakeTag, | 193 MakeTag, |
193 CleanUp, | 194 CleanUp, |
194 ] | 195 ] |
195 | 196 |
196 | 197 |
197 if __name__ == "__main__": # pragma: no cover | 198 if __name__ == "__main__": # pragma: no cover |
198 sys.exit(AutoTag(CONFIG).Run()) | 199 sys.exit(AutoTag().Run()) |
OLD | NEW |