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

Unified Diff: tools/push-to-trunk/releases.py

Issue 702843002: Make merge_to_branch more git-friendly. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review Created 6 years, 1 month 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/push-to-trunk/merge_to_branch.py ('k') | tools/push-to-trunk/test_scripts.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/push-to-trunk/releases.py
diff --git a/tools/push-to-trunk/releases.py b/tools/push-to-trunk/releases.py
index 53648a6180ed134d7e91f5a9de91e8ba2f0a4dfd..2090c00feb9ce453114eb18486a4784b30c1ff24 100755
--- a/tools/push-to-trunk/releases.py
+++ b/tools/push-to-trunk/releases.py
@@ -33,10 +33,18 @@ PUSH_MSG_GIT_RE = re.compile(r".* \(based on ([a-fA-F0-9]+)\)$")
# (old and new format).
MERGE_MESSAGE_RE = re.compile(r"^.*[M|m]erged (.+)(\)| into).*$", re.M)
+CHERRY_PICK_TITLE_GIT_RE = re.compile(r"^.* \(cherry\-pick\)\.?$")
+
+# New git message for cherry-picked CLs. One message per line.
+MERGE_MESSAGE_GIT_RE = re.compile(r"^Merged ([a-fA-F0-9]+)\.?$")
+
# Expression for retrieving reverted patches from a commit message (old and
# new format).
ROLLBACK_MESSAGE_RE = re.compile(r"^.*[R|r]ollback of (.+)(\)| in).*$", re.M)
+# New git message for reverted CLs. One message per line.
+ROLLBACK_MESSAGE_GIT_RE = re.compile(r"^Rollback of ([a-fA-F0-9]+)\.?$")
+
# Expression for retrieving the code review link.
REVIEW_LINK_RE = re.compile(r"^Review URL: (.+)$", re.M)
@@ -143,6 +151,18 @@ class RetrieveV8Releases(Step):
patches = "-%s" % patches
return patches
+ def GetMergedPatchesGit(self, body):
+ patches = []
+ for line in body.splitlines():
+ patch = MatchSafe(MERGE_MESSAGE_GIT_RE.match(line))
+ if patch:
+ patches.append(patch)
+ patch = MatchSafe(ROLLBACK_MESSAGE_GIT_RE.match(line))
+ if patch:
+ patches.append("-%s" % patch)
+ return ", ".join(patches)
+
+
def GetReleaseDict(
self, git_hash, bleeding_edge_rev, bleeding_edge_git, branch, version,
patches, cl_body):
@@ -185,7 +205,10 @@ class RetrieveV8Releases(Step):
patches = ""
if self["patch"] != "0":
version += ".%s" % self["patch"]
- patches = self.GetMergedPatches(body)
+ if CHERRY_PICK_TITLE_GIT_RE.match(body.splitlines()[0]):
+ patches = self.GetMergedPatchesGit(body)
+ else:
+ patches = self.GetMergedPatches(body)
title = self.GitLog(n=1, format="%s", git_hash=git_hash)
bleeding_edge_revision = self.GetBleedingEdgeFromPush(title)
« no previous file with comments | « tools/push-to-trunk/merge_to_branch.py ('k') | tools/push-to-trunk/test_scripts.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698