Fix change log generation in push-to-trunk script.
authormachenbach@chromium.org <machenbach@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 3 Dec 2013 09:13:51 +0000 (09:13 +0000)
committermachenbach@chromium.org <machenbach@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 3 Dec 2013 09:13:51 +0000 (09:13 +0000)
Fixed missing parenthesis in regular expression. The log checker matched on the word "true" and included a wrong change log entry.

TEST=python -m unittest test_scripts.ToplevelTest.testRegressWrongLogEntryOnTrue
R=ulan@chromium.org

Review URL: https://codereview.chromium.org/99573003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18220 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

tools/push-to-trunk/common_includes.py
tools/push-to-trunk/test_scripts.py

index 1965937..a2f0748 100644 (file)
@@ -105,7 +105,7 @@ def MakeChangeLogBody(commit_messages, auto_format=False):
     title = title.strip()
     if auto_format:
       # Only add commits that set the LOG flag correctly.
-      log_exp = r"^[ \t]*LOG[ \t]*=[ \t]*(?:Y(?:ES)?)|TRUE"
+      log_exp = r"^[ \t]*LOG[ \t]*=[ \t]*(?:(?:Y(?:ES)?)|TRUE)"
       if not re.search(log_exp, body, flags=re.I | re.M):
         continue
       # Never include reverts.
index acb28a0..1fd204d 100644 (file)
@@ -103,6 +103,17 @@ class ToplevelTest(unittest.TestCase):
                       "        Title text 3 (Chromium issue 1234).\n\n",
                       MakeChangeLogBody(commits, True))
 
+  def testRegressWrongLogEntryOnTrue(self):
+    body = """
+Check elimination: Learn from if(CompareMap(x)) on true branch.
+
+BUG=
+R=verwaest@chromium.org
+
+Committed: https://code.google.com/p/v8/source/detail?r=18210
+"""
+    self.assertEquals("", MakeChangeLogBody([["title", body, "author"]], True))
+
   def testMakeChangeLogBugReferenceEmpty(self):
     self.assertEquals("", MakeChangeLogBugReference(""))
     self.assertEquals("", MakeChangeLogBugReference("LOG="))