Reviewers: Jakob,
Message:
PTAL
Description:
Show v8 bleeding edge revision in trunk commit message.
This CL also improves some test code:
- Don't loose assertion exceptions in mocked git on retry.
- Remove an unused method
BUG=
Please review this at https://codereview.chromium.org/139993006/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files (+23, -8 lines):
M tools/push-to-trunk/push_to_trunk.py
M tools/push-to-trunk/test_scripts.py
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
a9342283417ad067d6f98cbed982bd948a23ff91..a5391b504baa74ec5ec130100ac995474779b035
100755
--- a/tools/push-to-trunk/push_to_trunk.py
+++ b/tools/push-to-trunk/push_to_trunk.py
@@ -292,6 +292,14 @@ class SquashCommits(Step):
# 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()
+ text = MSub(r"^(Version \d+\.\d+\.\d+)$",
+ "\\1 (V8 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):
Index: tools/push-to-trunk/test_scripts.py
diff --git a/tools/push-to-trunk/test_scripts.py
b/tools/push-to-trunk/test_scripts.py
index
a8200ee265eb38d5bb84ccc7ab5cdd0721756993..1f33ff38a0eb2d124ca8e2923cc2b5b3520404e7
100644
--- a/tools/push-to-trunk/test_scripts.py
+++ b/tools/push-to-trunk/test_scripts.py
@@ -28,6 +28,7 @@
import os
import tempfile
+import traceback
import unittest
import common_includes
@@ -247,7 +248,11 @@ class SimpleMock(object):
# 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.
@@ -563,6 +568,7 @@ class ScriptTest(unittest.TestCase):
self.ExpectGit([
["diff svn/trunk hash1", "patch content"],
+ ["svn find-rev hash1", "123455\n"],
])
self.MakeStep().Persist("prepare_commit_hash", "hash1")
@@ -581,7 +587,7 @@ class ScriptTest(unittest.TestCase):
Chromium issue 12345
Performance and stability improvements on all platforms.\n"""
- commit_msg = """Version 3.22.5
+ commit_msg = """Version 3.22.5 (V8 revision r123455)
Log text 1. Chromium issue 12345
@@ -595,7 +601,7 @@ Performance and stability improvements on all
platforms."""
12345).
Performance and stability improvements on all platforms.\n"""
- commit_msg = """Version 3.22.5
+ commit_msg = """Version 3.22.5 (V8 revision r123455)
Long commit message that fills more than 80 characters (Chromium issue
12345).
@@ -631,13 +637,13 @@ Performance and stability improvements on all
platforms."""
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 (V8 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))
@@ -676,6 +682,7 @@ Performance and stability improvements on all
platforms."""
"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], ""],
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.