From 0fd816940805b0a5b83e1723d491beb45ff00131 Mon Sep 17 00:00:00 2001 From: "machenbach@chromium.org" Date: Tue, 3 Dec 2013 09:13:51 +0000 Subject: [PATCH] Fix change log generation in push-to-trunk script. 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 | 2 +- tools/push-to-trunk/test_scripts.py | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/tools/push-to-trunk/common_includes.py b/tools/push-to-trunk/common_includes.py index 1965937..a2f0748 100644 --- a/tools/push-to-trunk/common_includes.py +++ b/tools/push-to-trunk/common_includes.py @@ -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. diff --git a/tools/push-to-trunk/test_scripts.py b/tools/push-to-trunk/test_scripts.py index acb28a0..1fd204d 100644 --- a/tools/push-to-trunk/test_scripts.py +++ b/tools/push-to-trunk/test_scripts.py @@ -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=")) -- 2.7.4