Diff
Modified: trunk/Tools/ChangeLog (141828 => 141829)
--- trunk/Tools/ChangeLog 2013-02-05 00:28:35 UTC (rev 141828)
+++ trunk/Tools/ChangeLog 2013-02-05 00:30:22 UTC (rev 141829)
@@ -1,3 +1,33 @@
+2013-02-04 Timothy Loh <[email protected]>
+
+ Don't update author info in PrepareChangeLog and allow users to skip the PrepareChangeLog step entirely.
+ https://bugs.webkit.org/show_bug.cgi?id=108788
+
+ Reviewed by Ryosuke Niwa.
+
+ As per discussion in Bug 74358, it's probably preferable to remove the
+ behaviour of updating the author details in a ChangeLog entry. We also
+ want to be able to skip preparing change logs (e.g. rebaselining many
+ tests), so a --no-prepare-changelogs option is added to webkit-patch.
+
+ * Scripts/webkitpy/common/checkout/changelog.py:
+ (ChangeLogEntry._parse_entry):
+ (ChangeLogEntry.date): Added
+ * Scripts/webkitpy/common/checkout/changelog_unittest.py:
+ (test_parse_log_entries_from_changelog):
+ * Scripts/webkitpy/tool/commands/commandtest.py:
+ (CommandsTest.assert_execute_outputs):
+ * Scripts/webkitpy/tool/steps/options.py:
+ (Options): Added --no-prepare-changelogs
+ * Scripts/webkitpy/tool/steps/preparechangelog.py:
+ (PrepareChangeLog.options):
+ (PrepareChangeLog._merge_entries): date_line() gets the entire line, including
+ the author's name and email, but we only want to replace the date.
+ (PrepareChangeLog.run):
+ * Scripts/webkitpy/tool/steps/preparechangelog_unittest.py:
+ (PrepareChangeLogTest.test_resolve_existing_entry): Added tests for changed
+ authors. Removed unneeded variable.
+
2013-02-04 Jochen Eisinger <[email protected]>
[chromium] Remove WebEventSender and WebAccessibilityController from public TestRunner API
Modified: trunk/Tools/Scripts/webkitpy/common/checkout/changelog.py (141828 => 141829)
--- trunk/Tools/Scripts/webkitpy/common/checkout/changelog.py 2013-02-05 00:28:35 UTC (rev 141828)
+++ trunk/Tools/Scripts/webkitpy/common/checkout/changelog.py 2013-02-05 00:30:22 UTC (rev 141829)
@@ -195,6 +195,7 @@
_log.warning("Creating invalid ChangeLogEntry:\n%s" % self._contents)
self._date_line = match.group()
+ self._date = match.group("date")
self._bug_description = self._parse_bug_description(self._contents)
# FIXME: group("name") does not seem to be Unicode? Probably due to self._contents not being unicode.
@@ -211,6 +212,9 @@
def date_line(self):
return self._date_line
+ def date(self):
+ return self._date
+
def author_text(self):
return self._author_text
Modified: trunk/Tools/Scripts/webkitpy/common/checkout/changelog_unittest.py (141828 => 141829)
--- trunk/Tools/Scripts/webkitpy/common/checkout/changelog_unittest.py 2013-02-05 00:28:35 UTC (rev 141828)
+++ trunk/Tools/Scripts/webkitpy/common/checkout/changelog_unittest.py 2013-02-05 00:30:22 UTC (rev 141829)
@@ -237,8 +237,11 @@
parsed_entries = list(ChangeLog.parse_entries_from_file(changelog_file))
self.assertEqual(len(parsed_entries), 9)
self.assertEqual(parsed_entries[0].date_line(), u"2009-08-17 Tor Arne Vestb\xf8 <[email protected]>")
+ self.assertEqual(parsed_entries[0].date(), "2009-08-17")
self.assertEqual(parsed_entries[0].reviewer_text(), "David Levin")
self.assertEqual(parsed_entries[0].is_touched_files_text_clean(), False)
+ self.assertEqual(parsed_entries[1].date_line(), "2009-08-16 David Kilzer <[email protected]>")
+ self.assertEqual(parsed_entries[1].date(), "2009-08-16")
self.assertEqual(parsed_entries[1].author_email(), "[email protected]")
self.assertEqual(parsed_entries[1].touched_files_text(), " * Scripts/bugzilla-tool:\n * Scripts/modules/scm.py:\n")
self.assertEqual(parsed_entries[1].is_touched_files_text_clean(), True)
Modified: trunk/Tools/Scripts/webkitpy/tool/commands/commandtest.py (141828 => 141829)
--- trunk/Tools/Scripts/webkitpy/tool/commands/commandtest.py 2013-02-05 00:28:35 UTC (rev 141828)
+++ trunk/Tools/Scripts/webkitpy/tool/commands/commandtest.py 2013-02-05 00:30:22 UTC (rev 141829)
@@ -42,6 +42,7 @@
options.obsolete_patches = True
options.open_bug = True
options.port = 'MOCK port'
+ options.prepare_changelogs = True
options.quiet = True
options.reviewer = 'MOCK reviewer'
command.bind_to_tool(tool)
Modified: trunk/Tools/Scripts/webkitpy/tool/steps/options.py (141828 => 141829)
--- trunk/Tools/Scripts/webkitpy/tool/steps/options.py 2013-02-05 00:28:35 UTC (rev 141828)
+++ trunk/Tools/Scripts/webkitpy/tool/steps/options.py 2013-02-05 00:30:22 UTC (rev 141829)
@@ -49,6 +49,7 @@
obsolete_patches = make_option("--no-obsolete", action="" dest="obsolete_patches", default=True, help="Do not obsolete old patches before posting this one.")
open_bug = make_option("--open-bug", action="" dest="open_bug", default=False, help="Opens the associated bug in a browser.")
parent_command = make_option("--parent-command", action="" dest="parent_command", default=None, help="(Internal) The command that spawned this instance.")
+ prepare_changelogs = make_option("--no-prepare-changelogs", action="" dest="prepare_changelogs", default=True, help="Don't prepare (create and/or update) ChangeLogs.")
quiet = make_option("--quiet", action="" dest="quiet", default=False, help="Produce less console output.")
request_commit = make_option("--request-commit", action="" dest="request_commit", default=False, help="Mark the patch as needing auto-commit after review.")
review = make_option("--no-review", action="" dest="review", default=True, help="Do not mark the patch for review.")
Modified: trunk/Tools/Scripts/webkitpy/tool/steps/preparechangelog.py (141828 => 141829)
--- trunk/Tools/Scripts/webkitpy/tool/steps/preparechangelog.py 2013-02-05 00:28:35 UTC (rev 141828)
+++ trunk/Tools/Scripts/webkitpy/tool/steps/preparechangelog.py 2013-02-05 00:30:22 UTC (rev 141829)
@@ -45,6 +45,7 @@
Options.quiet,
Options.email,
Options.git_commit,
+ Options.prepare_changelogs,
]
def _ensure_bug_url(self, state):
@@ -83,10 +84,7 @@
def _merge_entries(self, old_entry, new_entry):
final_entry = old_entry.contents()
- new_date_line = new_entry.date_line()
- old_date_line = old_entry.date_line()
- if new_date_line != old_date_line:
- final_entry = final_entry.replace(old_date_line, new_date_line)
+ final_entry = final_entry.replace(old_entry.date(), new_entry.date(), 1)
new_bug_desc = new_entry.bug_description()
old_bug_desc = old_entry.bug_description()
@@ -104,6 +102,9 @@
return final_entry + "\n"
def run(self, state):
+ if not self._options.prepare_changelogs:
+ return
+
if self.cached_lookup(state, "changelogs"):
self._ensure_bug_url(state)
Modified: trunk/Tools/Scripts/webkitpy/tool/steps/preparechangelog_unittest.py (141828 => 141829)
--- trunk/Tools/Scripts/webkitpy/tool/steps/preparechangelog_unittest.py 2013-02-05 00:28:35 UTC (rev 141828)
+++ trunk/Tools/Scripts/webkitpy/tool/steps/preparechangelog_unittest.py 2013-02-05 00:30:22 UTC (rev 141829)
@@ -40,12 +40,12 @@
def test_resolve_existing_entry(self):
step = PrepareChangeLog(MockTool(), MockOptions())
- roll_over = "== Rolled over to ChangeLog-2012-10-02 =="
-
headers = ["2013-01-18 Timothy Loh <[email protected]>\n\n",
"2013-01-20 Timothy Loh <[email protected]>\n\n",
u"2009-08-17 Tor Arne Vestb\xf8 <[email protected]>\n\n",
u"2009-08-18 Tor Arne Vestb\xf8 <[email protected]>\n\n",
+ "2013-01-18 Eric Seidel <[email protected]>\n\n",
+ "2013-01-20 Eric Seidel <[email protected]>\n\n",
]
bug_descs = [" prepare-Changelog should support updating the list of changed files\n",
@@ -93,15 +93,19 @@
((0, 0, 0, 1), (0, 0, 1, 2), (0, 0, 1, 3)),
((1, 1, 0, 1), (0, 0, 0, 2), (1, 1, 0, 3)),
((3, 0, 0, 0), (2, 0, 1, 0), (3, 0, 1, 0)),
+ ((4, 0, 0, 0), (0, 0, 0, 0), (0, 0, 0, 0)),
+ ((5, 0, 0, 0), (0, 0, 0, 0), (1, 0, 0, 0)),
+ ((0, 0, 0, 0), (4, 0, 0, 0), (4, 0, 0, 0)),
+ ((1, 0, 0, 0), (4, 0, 0, 0), (5, 0, 0, 0)),
]
for new, old, final in test_cases:
new_entry = make_entry(new)
old_entry = make_entry(old)
- start_file = new_entry + old_entry + roll_over
+ start_file = new_entry + old_entry + self._rolled_over_footer
final_entry = make_entry(final)
- end_file = final_entry + roll_over
+ end_file = final_entry + self._rolled_over_footer
path = "ChangeLog"
step._tool.filesystem = MockFileSystem()