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 import argparse | 9 import argparse |
10 import csv | 10 import csv |
(...skipping 21 matching lines...) Expand all Loading... |
32 PUSH_MESSAGE_RE = re.compile(r".* \(based on bleeding_edge revision r(\d+)\)$") | 32 PUSH_MESSAGE_RE = re.compile(r".* \(based on bleeding_edge revision r(\d+)\)$") |
33 | 33 |
34 # Expression for retrieving the merged patches from a merge commit message | 34 # Expression for retrieving the merged patches from a merge commit message |
35 # (old and new format). | 35 # (old and new format). |
36 MERGE_MESSAGE_RE = re.compile(r"^.*[M|m]erged (.+)(\)| into).*$", re.M) | 36 MERGE_MESSAGE_RE = re.compile(r"^.*[M|m]erged (.+)(\)| into).*$", re.M) |
37 | 37 |
38 # Expression for retrieving reverted patches from a commit message (old and | 38 # Expression for retrieving reverted patches from a commit message (old and |
39 # new format). | 39 # new format). |
40 ROLLBACK_MESSAGE_RE = re.compile(r"^.*[R|r]ollback of (.+)(\)| in).*$", re.M) | 40 ROLLBACK_MESSAGE_RE = re.compile(r"^.*[R|r]ollback of (.+)(\)| in).*$", re.M) |
41 | 41 |
| 42 # Expression for retrieving the code review link. |
| 43 REVIEW_LINK_RE = re.compile(r"^Review URL: (.+)$", re.M) |
| 44 |
42 # Expression with three versions (historical) for extracting the v8 revision | 45 # Expression with three versions (historical) for extracting the v8 revision |
43 # from the chromium DEPS file. | 46 # from the chromium DEPS file. |
44 DEPS_RE = re.compile(r'^\s*(?:"v8_revision": "' | 47 DEPS_RE = re.compile(r'^\s*(?:"v8_revision": "' |
45 '|\(Var\("googlecode_url"\) % "v8"\) \+ "\/trunk@' | 48 '|\(Var\("googlecode_url"\) % "v8"\) \+ "\/trunk@' |
46 '|"http\:\/\/v8\.googlecode\.com\/svn\/trunk@)' | 49 '|"http\:\/\/v8\.googlecode\.com\/svn\/trunk@)' |
47 '([0-9]+)".*$', re.M) | 50 '([0-9]+)".*$', re.M) |
48 | 51 |
49 | 52 |
50 def SortingKey(version): | 53 def SortingKey(version): |
51 """Key for sorting version number strings: '3.11' > '3.2.1.1'""" | 54 """Key for sorting version number strings: '3.11' > '3.2.1.1'""" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 class RetrieveV8Releases(Step): | 130 class RetrieveV8Releases(Step): |
128 MESSAGE = "Retrieve all V8 releases." | 131 MESSAGE = "Retrieve all V8 releases." |
129 | 132 |
130 def ExceedsMax(self, releases): | 133 def ExceedsMax(self, releases): |
131 return (self._options.max_releases > 0 | 134 return (self._options.max_releases > 0 |
132 and len(releases) > self._options.max_releases) | 135 and len(releases) > self._options.max_releases) |
133 | 136 |
134 def GetBleedingEdgeFromPush(self, title): | 137 def GetBleedingEdgeFromPush(self, title): |
135 return MatchSafe(PUSH_MESSAGE_RE.match(title)) | 138 return MatchSafe(PUSH_MESSAGE_RE.match(title)) |
136 | 139 |
137 def GetMergedPatches(self, git_hash): | 140 def GetMergedPatches(self, body): |
138 body = self.GitLog(n=1, format="%B", git_hash=git_hash) | |
139 patches = MatchSafe(MERGE_MESSAGE_RE.search(body)) | 141 patches = MatchSafe(MERGE_MESSAGE_RE.search(body)) |
140 if not patches: | 142 if not patches: |
141 patches = MatchSafe(ROLLBACK_MESSAGE_RE.search(body)) | 143 patches = MatchSafe(ROLLBACK_MESSAGE_RE.search(body)) |
142 if patches: | 144 if patches: |
143 # Indicate reverted patches with a "-". | 145 # Indicate reverted patches with a "-". |
144 patches = "-%s" % patches | 146 patches = "-%s" % patches |
145 return patches | 147 return patches |
146 | 148 |
147 def GetRelease(self, git_hash, branch): | 149 def GetRelease(self, git_hash, branch): |
148 self.ReadAndPersistVersion() | 150 self.ReadAndPersistVersion() |
149 base_version = [self["major"], self["minor"], self["build"]] | 151 base_version = [self["major"], self["minor"], self["build"]] |
150 version = ".".join(base_version) | 152 version = ".".join(base_version) |
| 153 body = self.GitLog(n=1, format="%B", git_hash=git_hash) |
151 | 154 |
152 patches = "" | 155 patches = "" |
153 if self["patch"] != "0": | 156 if self["patch"] != "0": |
154 version += ".%s" % self["patch"] | 157 version += ".%s" % self["patch"] |
155 patches = self.GetMergedPatches(git_hash) | 158 patches = self.GetMergedPatches(body) |
156 | 159 |
157 title = self.GitLog(n=1, format="%s", git_hash=git_hash) | 160 title = self.GitLog(n=1, format="%s", git_hash=git_hash) |
| 161 revision = self.GitSVNFindSVNRev(git_hash) |
158 return { | 162 return { |
159 # The SVN revision on the branch. | 163 # The SVN revision on the branch. |
160 "revision": self.GitSVNFindSVNRev(git_hash), | 164 "revision": revision, |
161 # The SVN revision on bleeding edge (only for newer trunk pushes). | 165 # The SVN revision on bleeding edge (only for newer trunk pushes). |
162 "bleeding_edge": self.GetBleedingEdgeFromPush(title), | 166 "bleeding_edge": self.GetBleedingEdgeFromPush(title), |
163 # The branch name. | 167 # The branch name. |
164 "branch": branch, | 168 "branch": branch, |
165 # The version for displaying in the form 3.26.3 or 3.26.3.12. | 169 # The version for displaying in the form 3.26.3 or 3.26.3.12. |
166 "version": version, | 170 "version": version, |
167 # Merged patches if available in the form 'r1234, r2345'. | 171 # Merged patches if available in the form 'r1234, r2345'. |
168 "patches_merged": patches, | 172 "patches_merged": patches, |
169 # Default for easier output formatting. | 173 # Default for easier output formatting. |
170 "chromium_revision": "", | 174 "chromium_revision": "", |
| 175 # Link to the CL on code review. Trunk pushes are not uploaded, so this |
| 176 # field will be populated below with the recent roll CL link. |
| 177 "review_link": MatchSafe(REVIEW_LINK_RE.search(body)), |
| 178 # Link to the commit message on google code. |
| 179 "revision_link": ("https://code.google.com/p/v8/source/detail?r=%s" |
| 180 % revision), |
171 }, self["patch"] | 181 }, self["patch"] |
172 | 182 |
173 def GetReleasesFromBranch(self, branch): | 183 def GetReleasesFromBranch(self, branch): |
174 self.GitReset("svn/%s" % branch) | 184 self.GitReset("svn/%s" % branch) |
175 releases = [] | 185 releases = [] |
176 try: | 186 try: |
177 for git_hash in self.GitLog(format="%H").splitlines(): | 187 for git_hash in self.GitLog(format="%H").splitlines(): |
178 if self._config[VERSION_FILE] not in self.GitChangedFiles(git_hash): | 188 if self._config[VERSION_FILE] not in self.GitChangedFiles(git_hash): |
179 continue | 189 continue |
180 if self.ExceedsMax(releases): | 190 if self.ExceedsMax(releases): |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 UpdateChromiumCheckout, | 387 UpdateChromiumCheckout, |
378 RetrieveChromiumV8Releases, | 388 RetrieveChromiumV8Releases, |
379 SwitchV8, | 389 SwitchV8, |
380 CleanUp, | 390 CleanUp, |
381 WriteOutput, | 391 WriteOutput, |
382 ] | 392 ] |
383 | 393 |
384 | 394 |
385 if __name__ == "__main__": # pragma: no cover | 395 if __name__ == "__main__": # pragma: no cover |
386 sys.exit(Releases(CONFIG).Run()) | 396 sys.exit(Releases(CONFIG).Run()) |
OLD | NEW |