Changeset 141829 in webkit


Ignore:
Timestamp:
Feb 4, 2013 4:30:22 PM (11 years ago)
Author:
commit-queue@webkit.org
Message:

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

Patch by Timothy Loh <timloh@chromium.com> on 2013-02-04
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.

Location:
trunk/Tools
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r141823 r141829  
     12013-02-04  Timothy Loh  <timloh@chromium.com>
     2
     3        Don't update author info in PrepareChangeLog and allow users to skip the PrepareChangeLog step entirely.
     4        https://bugs.webkit.org/show_bug.cgi?id=108788
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        As per discussion in Bug 74358, it's probably preferable to remove the
     9        behaviour of updating the author details in a ChangeLog entry. We also
     10        want to be able to skip preparing change logs (e.g. rebaselining many
     11        tests), so a --no-prepare-changelogs option is added to webkit-patch.
     12
     13        * Scripts/webkitpy/common/checkout/changelog.py:
     14        (ChangeLogEntry._parse_entry):
     15        (ChangeLogEntry.date): Added
     16        * Scripts/webkitpy/common/checkout/changelog_unittest.py:
     17        (test_parse_log_entries_from_changelog):
     18        * Scripts/webkitpy/tool/commands/commandtest.py:
     19        (CommandsTest.assert_execute_outputs):
     20        * Scripts/webkitpy/tool/steps/options.py:
     21        (Options): Added --no-prepare-changelogs
     22        * Scripts/webkitpy/tool/steps/preparechangelog.py:
     23        (PrepareChangeLog.options):
     24        (PrepareChangeLog._merge_entries): date_line() gets the entire line, including
     25        the author's name and email, but we only want to replace the date.
     26        (PrepareChangeLog.run):
     27        * Scripts/webkitpy/tool/steps/preparechangelog_unittest.py:
     28        (PrepareChangeLogTest.test_resolve_existing_entry): Added tests for changed
     29        authors. Removed unneeded variable.
     30
    1312013-02-04  Jochen Eisinger  <jochen@chromium.org>
    232
  • trunk/Tools/Scripts/webkitpy/common/checkout/changelog.py

    r141723 r141829  
    196196
    197197        self._date_line = match.group()
     198        self._date = match.group("date")
    198199        self._bug_description = self._parse_bug_description(self._contents)
    199200
     
    211212    def date_line(self):
    212213        return self._date_line
     214
     215    def date(self):
     216        return self._date
    213217
    214218    def author_text(self):
  • trunk/Tools/Scripts/webkitpy/common/checkout/changelog_unittest.py

    r141723 r141829  
    238238        self.assertEqual(len(parsed_entries), 9)
    239239        self.assertEqual(parsed_entries[0].date_line(), u"2009-08-17  Tor Arne Vestb\xf8  <vestbo@webkit.org>")
     240        self.assertEqual(parsed_entries[0].date(), "2009-08-17")
    240241        self.assertEqual(parsed_entries[0].reviewer_text(), "David Levin")
    241242        self.assertEqual(parsed_entries[0].is_touched_files_text_clean(), False)
     243        self.assertEqual(parsed_entries[1].date_line(), "2009-08-16  David Kilzer  <ddkilzer@apple.com>")
     244        self.assertEqual(parsed_entries[1].date(), "2009-08-16")
    242245        self.assertEqual(parsed_entries[1].author_email(), "ddkilzer@apple.com")
    243246        self.assertEqual(parsed_entries[1].touched_files_text(), "        * Scripts/bugzilla-tool:\n        * Scripts/modules/scm.py:\n")
  • trunk/Tools/Scripts/webkitpy/tool/commands/commandtest.py

    r135744 r141829  
    4343        options.open_bug = True
    4444        options.port = 'MOCK port'
     45        options.prepare_changelogs = True
    4546        options.quiet = True
    4647        options.reviewer = 'MOCK reviewer'
  • trunk/Tools/Scripts/webkitpy/tool/steps/options.py

    r136555 r141829  
    5050    open_bug = make_option("--open-bug", action="store_true", dest="open_bug", default=False, help="Opens the associated bug in a browser.")
    5151    parent_command = make_option("--parent-command", action="store", dest="parent_command", default=None, help="(Internal) The command that spawned this instance.")
     52    prepare_changelogs = make_option("--no-prepare-changelogs", action="store_false", dest="prepare_changelogs", default=True, help="Don't prepare (create and/or update) ChangeLogs.")
    5253    quiet = make_option("--quiet", action="store_true", dest="quiet", default=False, help="Produce less console output.")
    5354    request_commit = make_option("--request-commit", action="store_true", dest="request_commit", default=False, help="Mark the patch as needing auto-commit after review.")
  • trunk/Tools/Scripts/webkitpy/tool/steps/preparechangelog.py

    r141022 r141829  
    4646            Options.email,
    4747            Options.git_commit,
     48            Options.prepare_changelogs,
    4849        ]
    4950
     
    8485        final_entry = old_entry.contents()
    8586
    86         new_date_line = new_entry.date_line()
    87         old_date_line = old_entry.date_line()
    88         if new_date_line != old_date_line:
    89             final_entry = final_entry.replace(old_date_line, new_date_line)
     87        final_entry = final_entry.replace(old_entry.date(), new_entry.date(), 1)
    9088
    9189        new_bug_desc = new_entry.bug_description()
     
    105103
    106104    def run(self, state):
     105        if not self._options.prepare_changelogs:
     106            return
     107
    107108        if self.cached_lookup(state, "changelogs"):
    108109            self._ensure_bug_url(state)
  • trunk/Tools/Scripts/webkitpy/tool/steps/preparechangelog_unittest.py

    r141022 r141829  
    4141        step = PrepareChangeLog(MockTool(), MockOptions())
    4242
    43         roll_over = "== Rolled over to ChangeLog-2012-10-02 =="
    44 
    4543        headers = ["2013-01-18  Timothy Loh  <timloh@chromium.com>\n\n",
    4644                   "2013-01-20  Timothy Loh  <timloh@chromium.com>\n\n",
    4745                  u"2009-08-17  Tor Arne Vestb\xf8  <vestbo@webkit.org>\n\n",
    4846                  u"2009-08-18  Tor Arne Vestb\xf8  <vestbo@webkit.org>\n\n",
     47                   "2013-01-18  Eric Seidel  <eric@webkit.org>\n\n",
     48                   "2013-01-20  Eric Seidel  <eric@webkit.org>\n\n",
    4949                  ]
    5050
     
    9494                      ((1, 1, 0, 1), (0, 0, 0, 2), (1, 1, 0, 3)),
    9595                      ((3, 0, 0, 0), (2, 0, 1, 0), (3, 0, 1, 0)),
     96                      ((4, 0, 0, 0), (0, 0, 0, 0), (0, 0, 0, 0)),
     97                      ((5, 0, 0, 0), (0, 0, 0, 0), (1, 0, 0, 0)),
     98                      ((0, 0, 0, 0), (4, 0, 0, 0), (4, 0, 0, 0)),
     99                      ((1, 0, 0, 0), (4, 0, 0, 0), (5, 0, 0, 0)),
    96100        ]
    97101
     
    99103            new_entry = make_entry(new)
    100104            old_entry = make_entry(old)
    101             start_file = new_entry + old_entry + roll_over
     105            start_file = new_entry + old_entry + self._rolled_over_footer
    102106
    103107            final_entry = make_entry(final)
    104             end_file = final_entry + roll_over
     108            end_file = final_entry + self._rolled_over_footer
    105109
    106110            path = "ChangeLog"
Note: See TracChangeset for help on using the changeset viewer.