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 # This script retrieves the history of all V8 branches and trunk revisions and | 6 # This script retrieves the history of all V8 branches and trunk revisions and |
7 # their corresponding Chromium revisions. | 7 # their corresponding Chromium revisions. |
8 | 8 |
9 # Requires a chromium checkout with branch heads: | 9 # Requires a chromium checkout with branch heads: |
10 # gclient sync --with_branch_heads | 10 # gclient sync --with_branch_heads |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 REVIEW_LINK_RE = re.compile(r"^Review URL: (.+)$", re.M) | 46 REVIEW_LINK_RE = re.compile(r"^Review URL: (.+)$", re.M) |
47 | 47 |
48 # Expression with three versions (historical) for extracting the v8 revision | 48 # Expression with three versions (historical) for extracting the v8 revision |
49 # from the chromium DEPS file. | 49 # from the chromium DEPS file. |
50 DEPS_RE = re.compile(r'^\s*(?:"v8_revision": "' | 50 DEPS_RE = re.compile(r'^\s*(?:"v8_revision": "' |
51 '|\(Var\("googlecode_url"\) % "v8"\) \+ "\/trunk@' | 51 '|\(Var\("googlecode_url"\) % "v8"\) \+ "\/trunk@' |
52 '|"http\:\/\/v8\.googlecode\.com\/svn\/trunk@)' | 52 '|"http\:\/\/v8\.googlecode\.com\/svn\/trunk@)' |
53 '([0-9]+)".*$', re.M) | 53 '([0-9]+)".*$', re.M) |
54 | 54 |
55 | 55 |
56 def SortingKey(version): | |
57 """Key for sorting version number strings: '3.11' > '3.2.1.1'""" | |
58 version_keys = map(int, version.split(".")) | |
59 # Fill up to full version numbers to normalize comparison. | |
60 while len(version_keys) < 4: | |
61 version_keys.append(0) | |
62 # Fill digits. | |
63 return ".".join(map("{0:03d}".format, version_keys)) | |
64 | |
65 | |
66 def SortBranches(branches): | 56 def SortBranches(branches): |
67 """Sort branches with version number names.""" | 57 """Sort branches with version number names.""" |
68 return sorted(branches, key=SortingKey, reverse=True) | 58 return sorted(branches, key=SortingKey, reverse=True) |
69 | 59 |
70 | 60 |
71 def FilterDuplicatesAndReverse(cr_releases): | 61 def FilterDuplicatesAndReverse(cr_releases): |
72 """Returns the chromium releases in reverse order filtered by v8 revision | 62 """Returns the chromium releases in reverse order filtered by v8 revision |
73 duplicates. | 63 duplicates. |
74 | 64 |
75 cr_releases is a list of [cr_rev, v8_rev] reverse-sorted by cr_rev. | 65 cr_releases is a list of [cr_rev, v8_rev] reverse-sorted by cr_rev. |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 RetrieveChromiumV8Releases, | 444 RetrieveChromiumV8Releases, |
455 RietrieveChromiumBranches, | 445 RietrieveChromiumBranches, |
456 SwitchV8, | 446 SwitchV8, |
457 CleanUp, | 447 CleanUp, |
458 WriteOutput, | 448 WriteOutput, |
459 ] | 449 ] |
460 | 450 |
461 | 451 |
462 if __name__ == "__main__": # pragma: no cover | 452 if __name__ == "__main__": # pragma: no cover |
463 sys.exit(Releases(CONFIG).Run()) | 453 sys.exit(Releases(CONFIG).Run()) |
OLD | NEW |