# Remove date and trailing white space.
text = re.sub(r"^%s: " % self._state["date"], "", text.rstrip())
+ # Retrieve svn revision for showing the used bleeding edge revision in the
+ # commit message.
+ args = "svn find-rev %s" % self._state["prepare_commit_hash"]
+ svn_revision = self.Git(args).strip()
+ self.Persist("svn_revision", svn_revision)
+ text = MSub(r"^(Version \d+\.\d+\.\d+)$",
+ "\\1 (based on bleeding_edge revision r%s)" % svn_revision,
+ text)
+
# Remove indentation and merge paragraphs into single long lines, keeping
# empty lines between them.
def SplitMapJoin(split_text, fun, join_text):
print "Please enter the email address of a reviewer for the roll CL: ",
self.DieNoManualMode("A reviewer must be specified in forced mode.")
rev = self.ReadLine()
- args = "commit -am \"Update V8 to version %s.\n\nTBR=%s\"" % (ver, rev)
+ self.RestoreIfUnset("svn_revision")
+ args = ("commit -am \"Update V8 to version %s "
+ "(based on bleeding_edge revision r%s).\n\nTBR=%s\""
+ % (ver, self._state["svn_revision"], rev))
if self.Git(args) is None:
self.Die("'git commit' failed.")
force_flag = " -f" if self._options.force_upload else ""
import os
import tempfile
+import traceback
import unittest
import common_includes
# The expectation list contains a mandatory return value and an optional
# callback for checking the context at the time of the call.
if len(expected_call) == len(args) + 2:
- expected_call[len(args) + 1]()
+ try:
+ expected_call[len(args) + 1]()
+ except:
+ tb = traceback.format_exc()
+ raise NoRetryException("Caught exception from callback: %s" % tb)
return_value = expected_call[len(args)]
# If the return value is an exception, raise it instead of returning.
self.ExpectGit([
["diff svn/trunk hash1", "patch content"],
+ ["svn find-rev hash1", "123455\n"],
])
self.MakeStep().Persist("prepare_commit_hash", "hash1")
Chromium issue 12345
Performance and stability improvements on all platforms.\n"""
- commit_msg = """Version 3.22.5
+ commit_msg = """Version 3.22.5 (based on bleeding_edge revision r123455)
Log text 1. Chromium issue 12345
12345).
Performance and stability improvements on all platforms.\n"""
- commit_msg = """Version 3.22.5
+ commit_msg = """Version 3.22.5 (based on bleeding_edge revision r123455)
Long commit message that fills more than 80 characters (Chromium issue 12345).
version = FileToText(TEST_CONFIG[VERSION_FILE])
self.assertTrue(re.search(r"#define BUILD_NUMBER\s+6", version))
- def CheckUpload():
- cl = FileToText(TEST_CONFIG[CHANGELOG_FILE])
-
def CheckSVNCommit():
commit = FileToText(TEST_CONFIG[COMMITMSG_FILE])
- self.assertTrue(re.search(r"Version 3.22.5", commit))
- self.assertTrue(re.search(r"Log text 1 \(issue 321\).", commit))
+ self.assertEquals(
+"""Version 3.22.5 (based on bleeding_edge revision r123455)
+
+Log text 1 (issue 321).
+
+Performance and stability improvements on all platforms.""", commit)
version = FileToText(TEST_CONFIG[VERSION_FILE])
self.assertTrue(re.search(r"#define MINOR_VERSION\s+22", version))
self.assertTrue(re.search(r"#define BUILD_NUMBER\s+5", version))
"Now working on version 3.22.6.\""),
"hash1\n"],
["diff svn/trunk hash1", "patch content\n"],
+ ["svn find-rev hash1", "123455\n"],
["checkout -b %s svn/trunk" % TEST_CONFIG[TRUNKBRANCH], ""],
["apply --index --reject \"%s\"" % TEST_CONFIG[PATCH_FILE], ""],
["add \"%s\"" % TEST_CONFIG[VERSION_FILE], ""],
["checkout master", ""],
["pull", ""],
["checkout -b v8-roll-123456", ""],
- [("commit -am \"Update V8 to version 3.22.5.\n\n"
+ [("commit -am \"Update V8 to version 3.22.5 "
+ "(based on bleeding_edge revision r123455).\n\n"
"TBR=reviewer@chromium.org\""),
""],
["cl upload --send-mail%s" % force_flag, ""],