Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Unified Diff: tools/release/common_includes.py

Issue 878913002: Let release scripts determine version based on tags. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove unused method. Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/release/chromium_roll.py ('k') | tools/release/push_to_candidates.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/release/common_includes.py
diff --git a/tools/release/common_includes.py b/tools/release/common_includes.py
index 65cf8572bb8f204d715786816febda64a41d1016..20da369e2dab3277f5eec57a354baf309eb38e82 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"
+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,23 +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:
- version_parts.append("0")
- self["latest_version"] = ".".join(version_parts)
- return self["latest_version"]
-
- def FindLastCandidatesPush(
- self, parent_hash="", branch="", include_patches=False):
- push_pattern = "^Version [[:digit:]]*\.[[:digit:]]*\.[[:digit:]]*"
- if not include_patches:
- # Non-patched versions only have three numbers followed by the "(based
- # on...) comment."
- push_pattern += " (based"
- branch = "" if parent_hash else branch or self.vc.RemoteCandidateBranch()
- return self.GitLog(n=1, format="%H", grep=push_pattern,
- parent_hash=parent_hash, branch=branch)
+ 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 ArrayToVersion(self, prefix):
return ".".join([self[prefix + "major"],
« no previous file with comments | « tools/release/chromium_roll.py ('k') | tools/release/push_to_candidates.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698