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

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

Issue 61263011: Refactor ChangeLog generation for push-to-trunk script. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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/common_includes.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/push-to-trunk/push_to_trunk.py
diff --git a/tools/push-to-trunk/push_to_trunk.py b/tools/push-to-trunk/push_to_trunk.py
index 669ba52f3ecfc95e2348b1346b35966bc24be9f3..04e992d72561d3bda315f9ec7cfc161f5b0fa25d 100755
--- a/tools/push-to-trunk/push_to_trunk.py
+++ b/tools/push-to-trunk/push_to_trunk.py
@@ -110,37 +110,22 @@ class PrepareChangeLog(Step):
args = "log %s..HEAD --format=%%H" % self._state["last_push"]
commits = self.Git(args).strip()
- for commit in commits.splitlines():
- # Get the commit's title line.
- args = "log -1 %s --format=\"%%w(80,8,8)%%s\"" % commit
- title = "%s\n" % self.Git(args).rstrip()
- AppendToFile(title, self.Config(CHANGELOG_ENTRY_FILE))
-
- # Grep for "BUG=xxxx" lines in the commit message and convert them to
- # "(issue xxxx)".
- out = self.Git("log -1 %s --format=\"%%B\"" % commit).splitlines()
- out = filter(lambda x: re.search(r"^BUG=", x), out)
- out = filter(lambda x: not re.search(r"BUG=$", x), out)
- out = filter(lambda x: not re.search(r"BUG=none$", x), out)
-
- # TODO(machenbach): Handle multiple entries (e.g. BUG=123, 234).
- def FormatIssue(text):
- text = re.sub(r"BUG=v8:(.*)$", r"(issue \1)", text)
- text = re.sub(r"BUG=chromium:(.*)$", r"(Chromium issue \1)", text)
- text = re.sub(r"BUG=(.*)$", r"(Chromium issue \1)", text)
- return " %s\n" % text
-
- for line in map(FormatIssue, out):
- AppendToFile(line, self.Config(CHANGELOG_ENTRY_FILE))
-
- # Append the commit's author for reference.
- args = "log -1 %s --format=\"%%w(80,8,8)(%%an)\"" % commit
- author = self.Git(args).rstrip()
- AppendToFile("%s\n\n" % author, self.Config(CHANGELOG_ENTRY_FILE))
+
+ def GetCommitMessages():
+ for commit in commits.splitlines():
+ yield [
+ self.Git("log -1 %s --format=\"%%w(80,8,8)%%s\"" % commit),
+ self.Git("log -1 %s --format=\"%%B\"" % commit),
+ self.Git("log -1 %s --format=\"%%w(80,8,8)(%%an)\"" % commit),
+ ]
+
+ body = MakeChangeLogBody(GetCommitMessages)
+ AppendToFile(body, self.Config(CHANGELOG_ENTRY_FILE))
msg = " Performance and stability improvements on all platforms.\n"
AppendToFile(msg, self.Config(CHANGELOG_ENTRY_FILE))
+
class EditChangeLog(Step):
def __init__(self):
Step.__init__(self, "Edit ChangeLog entry.")
« no previous file with comments | « tools/push-to-trunk/common_includes.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698