| 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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 def GetMergedPatches(self, body): | 133 def GetMergedPatches(self, body): |
| 134 patches = MatchSafe(MERGE_MESSAGE_RE.search(body)) | 134 patches = MatchSafe(MERGE_MESSAGE_RE.search(body)) |
| 135 if not patches: | 135 if not patches: |
| 136 patches = MatchSafe(ROLLBACK_MESSAGE_RE.search(body)) | 136 patches = MatchSafe(ROLLBACK_MESSAGE_RE.search(body)) |
| 137 if patches: | 137 if patches: |
| 138 # Indicate reverted patches with a "-". | 138 # Indicate reverted patches with a "-". |
| 139 patches = "-%s" % patches | 139 patches = "-%s" % patches |
| 140 return patches | 140 return patches |
| 141 | 141 |
| 142 def GetReleaseDict( | 142 def GetReleaseDict( |
| 143 self, git_hash, bleeding_edge_rev, branch, version, patches, cl_body): | 143 self, git_hash, bleeding_edge_rev, bleeding_edge_git, branch, version, |
| 144 patches, cl_body): |
| 144 revision = self.vc.GitSvn(git_hash) | 145 revision = self.vc.GitSvn(git_hash) |
| 145 return { | 146 return { |
| 146 # The SVN revision on the branch. | 147 # The SVN revision on the branch. |
| 147 "revision": revision, | 148 "revision": revision, |
| 149 # The git revision on the branch. |
| 150 "revision_git": git_hash, |
| 148 # The SVN revision on bleeding edge (only for newer trunk pushes). | 151 # The SVN revision on bleeding edge (only for newer trunk pushes). |
| 149 "bleeding_edge": bleeding_edge_rev, | 152 "bleeding_edge": bleeding_edge_rev, |
| 153 # The same for git. |
| 154 "bleeding_edge_git": bleeding_edge_git, |
| 150 # The branch name. | 155 # The branch name. |
| 151 "branch": branch, | 156 "branch": branch, |
| 152 # The version for displaying in the form 3.26.3 or 3.26.3.12. | 157 # The version for displaying in the form 3.26.3 or 3.26.3.12. |
| 153 "version": version, | 158 "version": version, |
| 154 # The date of the commit. | 159 # The date of the commit. |
| 155 "date": self.GitLog(n=1, format="%ci", git_hash=git_hash), | 160 "date": self.GitLog(n=1, format="%ci", git_hash=git_hash), |
| 156 # Merged patches if available in the form 'r1234, r2345'. | 161 # Merged patches if available in the form 'r1234, r2345'. |
| 157 "patches_merged": patches, | 162 "patches_merged": patches, |
| 158 # Default for easier output formatting. | 163 # Default for easier output formatting. |
| 159 "chromium_revision": "", | 164 "chromium_revision": "", |
| (...skipping 12 matching lines...) Expand all Loading... |
| 172 base_version = [self["major"], self["minor"], self["build"]] | 177 base_version = [self["major"], self["minor"], self["build"]] |
| 173 version = ".".join(base_version) | 178 version = ".".join(base_version) |
| 174 body = self.GitLog(n=1, format="%B", git_hash=git_hash) | 179 body = self.GitLog(n=1, format="%B", git_hash=git_hash) |
| 175 | 180 |
| 176 patches = "" | 181 patches = "" |
| 177 if self["patch"] != "0": | 182 if self["patch"] != "0": |
| 178 version += ".%s" % self["patch"] | 183 version += ".%s" % self["patch"] |
| 179 patches = self.GetMergedPatches(body) | 184 patches = self.GetMergedPatches(body) |
| 180 | 185 |
| 181 title = self.GitLog(n=1, format="%s", git_hash=git_hash) | 186 title = self.GitLog(n=1, format="%s", git_hash=git_hash) |
| 187 bleeding_edge_revision = self.GetBleedingEdgeFromPush(title) |
| 188 bleeding_edge_git = "" |
| 189 if bleeding_edge_revision: |
| 190 bleeding_edge_git = self.vc.SvnGit(bleeding_edge_revision, |
| 191 self.vc.RemoteMasterBranch()) |
| 182 return self.GetReleaseDict( | 192 return self.GetReleaseDict( |
| 183 git_hash, self.GetBleedingEdgeFromPush(title), branch, version, | 193 git_hash, bleeding_edge_revision, bleeding_edge_git, branch, version, |
| 184 patches, body), self["patch"] | 194 patches, body), self["patch"] |
| 185 | 195 |
| 186 def GetReleasesFromMaster(self): | 196 def GetReleasesFromMaster(self): |
| 187 tag_text = self.SVN("log https://v8.googlecode.com/svn/tags -v --limit 20") | 197 tag_text = self.SVN("log https://v8.googlecode.com/svn/tags -v --limit 20") |
| 188 releases = [] | 198 releases = [] |
| 189 for (tag, revision) in re.findall(BLEEDING_EDGE_TAGS_RE, tag_text): | 199 for (tag, revision) in re.findall(BLEEDING_EDGE_TAGS_RE, tag_text): |
| 190 git_hash = self.vc.SvnGit(revision) | 200 git_hash = self.vc.SvnGit(revision) |
| 191 | 201 |
| 192 # Add bleeding edge release. It does not contain patches or a code | 202 # Add bleeding edge release. It does not contain patches or a code |
| 193 # review link, as tags are not uploaded. | 203 # review link, as tags are not uploaded. |
| 194 releases.append(self.GetReleaseDict( | 204 releases.append(self.GetReleaseDict( |
| 195 git_hash, revision, self.vc.MasterBranch(), tag, "", "")) | 205 git_hash, revision, git_hash, self.vc.MasterBranch(), tag, "", "")) |
| 196 return releases | 206 return releases |
| 197 | 207 |
| 198 def GetReleasesFromBranch(self, branch): | 208 def GetReleasesFromBranch(self, branch): |
| 199 self.GitReset(self.vc.RemoteBranch(branch)) | 209 self.GitReset(self.vc.RemoteBranch(branch)) |
| 200 if branch == self.vc.MasterBranch(): | 210 if branch == self.vc.MasterBranch(): |
| 201 return self.GetReleasesFromMaster() | 211 return self.GetReleasesFromMaster() |
| 202 | 212 |
| 203 releases = [] | 213 releases = [] |
| 204 try: | 214 try: |
| 205 for git_hash in self.GitLog(format="%H").splitlines(): | 215 for git_hash in self.GitLog(format="%H").splitlines(): |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 UpdateChromiumCheckout, | 470 UpdateChromiumCheckout, |
| 461 RetrieveChromiumV8Releases, | 471 RetrieveChromiumV8Releases, |
| 462 RietrieveChromiumBranches, | 472 RietrieveChromiumBranches, |
| 463 CleanUp, | 473 CleanUp, |
| 464 WriteOutput, | 474 WriteOutput, |
| 465 ] | 475 ] |
| 466 | 476 |
| 467 | 477 |
| 468 if __name__ == "__main__": # pragma: no cover | 478 if __name__ == "__main__": # pragma: no cover |
| 469 sys.exit(Releases().Run()) | 479 sys.exit(Releases().Run()) |
| OLD | NEW |