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

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

Issue 78683002: Let ChangeLog get auto-generated in push-to-trunk script. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review 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') | 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/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 8b763f54ec22ec1c062af4b32af1a8d584afb7a3..7278323e223b09379abef5402ba356be372f39ec 100755
--- a/tools/push-to-trunk/push_to_trunk.py
+++ b/tools/push-to-trunk/push_to_trunk.py
@@ -112,20 +112,29 @@ class PrepareChangeLog(Step):
args = "log %s..HEAD --format=%%H" % self._state["last_push"]
commits = self.Git(args).strip()
- 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)
+ # Cache raw commit messages.
+ commit_messages = [
+ [
+ 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),
+ ] for commit in commits.splitlines()
+ ]
+
+ # Auto-format commit messages.
+ body = MakeChangeLogBody(commit_messages, auto_format=True)
AppendToFile(body, self.Config(CHANGELOG_ENTRY_FILE))
- msg = " Performance and stability improvements on all platforms.\n"
+ msg = (" Performance and stability improvements on all platforms."
+ "\n#\n# The change log above is auto-generated. Please review if "
+ "all relevant\n# commit messages from the list below are included."
+ "\n# All lines starting with # will be stripped.\n#\n")
AppendToFile(msg, self.Config(CHANGELOG_ENTRY_FILE))
+ # Include unformatted commit messages as a reference in a comment.
+ comment_body = MakeComment(MakeChangeLogBody(commit_messages))
+ AppendToFile(comment_body, self.Config(CHANGELOG_ENTRY_FILE))
+
class EditChangeLog(Step):
def __init__(self):
@@ -143,9 +152,10 @@ class EditChangeLog(Step):
handle, new_changelog = tempfile.mkstemp()
os.close(handle)
- # (1) Eliminate tabs, (2) fix too little and (3) too much indentation, and
- # (4) eliminate trailing whitespace.
+ # (1) Strip comments, (2) eliminate tabs, (3) fix too little and (4) too
+ # much indentation, and (5) eliminate trailing whitespace.
changelog_entry = FileToText(self.Config(CHANGELOG_ENTRY_FILE)).rstrip()
+ changelog_entry = StripComments(changelog_entry)
changelog_entry = MSub(r"\t", r" ", changelog_entry)
changelog_entry = MSub(r"^ {1,7}([^ ])", r" \1", changelog_entry)
changelog_entry = MSub(r"^ {9,80}([^ ])", r" \1", changelog_entry)
« no previous file with comments | « tools/push-to-trunk/common_includes.py ('k') | tools/push-to-trunk/test_scripts.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698