Chromium Code Reviews| Index: tools/release/common_includes.py |
| diff --git a/tools/release/common_includes.py b/tools/release/common_includes.py |
| index 65cf8572bb8f204d715786816febda64a41d1016..af150e54aaeb25f39379e5ee44910adae2cafc06 100644 |
| --- a/tools/release/common_includes.py |
| +++ b/tools/release/common_includes.py |
| @@ -46,6 +46,7 @@ from git_recipes import GitRecipesMixin |
| from git_recipes import GitFailedException |
| CHANGELOG_FILE = "ChangeLog" |
|
Michael Achenbach
2015/01/27 11:39:03
This was moved from push_to_candidates.
|
| +PUSH_MSG_GIT_RE = re.compile(r".* \(based on (?P<git_rev>[a-fA-F0-9]+)\)$") |
| VERSION_FILE = os.path.join("src", "version.cc") |
| VERSION_RE = re.compile(r"^\d+\.\d+\.\d+(?:\.\d+)?$") |
| @@ -597,12 +598,44 @@ class Step(GitRecipesMixin): |
| # Make sure tags are fetched. |
| self.Git("fetch origin +refs/tags/*:refs/tags/*") |
| - version_parts = sorted(filter(VERSION_RE.match, self.vc.GetTags()), |
| - key=SortingKey, reverse=True)[0].split(".") |
| - if len(version_parts) == 3: |
|
Michael Achenbach
2015/01/27 11:39:03
This was a mistake. The version is used to later c
|
| - version_parts.append("0") |
| - self["latest_version"] = ".".join(version_parts) |
| - return self["latest_version"] |
| + version = sorted(filter(VERSION_RE.match, self.vc.GetTags()), |
| + key=SortingKey, reverse=True)[0] |
| + self["latest_version"] = version |
| + return version |
| + |
| + def GetLatestRelease(self): |
| + """The latest release is the git hash of the latest tagged version. |
| + |
| + This revision should be rolled into chromium. |
| + """ |
| + latest_version = self.GetLatestVersion() |
| + |
| + # The latest release. |
| + latest_hash = self.GitLog(n=1, format="%H", branch=latest_version) |
| + assert latest_hash |
| + return latest_hash |
| + |
| + def GetLatestReleaseBase(self): |
| + """The latest release base is the latest revision that is covered in the |
| + last change log file. It doesn't include cherry-picked patches. |
| + """ |
| + latest_version = self.GetLatestVersion() |
| + |
| + # Strip patch level if it exists. |
| + latest_version = ".".join(latest_version.split(".")[:3]) |
| + |
| + # The latest release base. |
| + latest_hash = self.GitLog(n=1, format="%H", branch=latest_version) |
| + assert latest_hash |
| + |
| + match = PUSH_MSG_GIT_RE.match( |
| + self.GitLog(n=1, format="%s", git_hash=latest_hash)) |
| + if match: |
| + # Legacy: In the old process there's one level of indirection. The |
| + # version is on the candidates branch and points to the real release |
| + # base on master through the commit message. |
| + latest_hash = match.group("git_rev") |
| + return latest_hash |
| def FindLastCandidatesPush( |
| self, parent_hash="", branch="", include_patches=False): |