Changeset 143119 in webkit


Ignore:
Timestamp:
Feb 16, 2013 5:03:59 PM (11 years ago)
Author:
rniwa@webkit.org
Message:

new-commit-bot should report the full name of committer and reviewer instead of just nicks
https://bugs.webkit.org/show_bug.cgi?id=110040

Reviewed by Darin Adler.

Have it report names like "Ryosuke Niwa (rniwa)" instead of just "rniwa".

  • Scripts/webkitpy/tool/commands/newcommitbot.py:

(NewCommitBot):
(NewCommitBot._summarize_commit_log):

  • Scripts/webkitpy/tool/commands/newcommitbot_unittest.py:
Location:
trunk/Tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r143109 r143119  
     12013-02-16  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        new-commit-bot should report the full name of committer and reviewer instead of just nicks
     4        https://bugs.webkit.org/show_bug.cgi?id=110040
     5
     6        Reviewed by Darin Adler.
     7
     8        Have it report names like "Ryosuke Niwa (rniwa)" instead of just "rniwa".
     9
     10        * Scripts/webkitpy/tool/commands/newcommitbot.py:
     11        (NewCommitBot):
     12        (NewCommitBot._summarize_commit_log):
     13        * Scripts/webkitpy/tool/commands/newcommitbot_unittest.py:
     14
    1152013-02-16  Ryosuke Niwa  <rniwa@webkit.org>
    216
  • trunk/Tools/Scripts/webkitpy/tool/commands/newcommitbot.py

    r143109 r143119  
    101101
    102102    _patch_by_regex = re.compile(r'^Patch\s+by\s+(?P<author>.+?)\s+on(\s+\d{4}-\d{2}-\d{2})?\n?', re.MULTILINE | re.IGNORECASE)
    103     _rollout_regex = re.compile(r'(rolling out|reverting) (?P<revisions>r?\d+((,\s*|,?\s*and\s+)?r?\d+)*)\.?', re.MULTILINE | re.IGNORECASE)
    104     _requested_by_regex = re.compile(r'^\"?(?P<reason>.+?)\"? \(Requested\s+by\s+(?P<author>.+)\s+on\s+#webkit\)\.', re.MULTILINE | re.IGNORECASE)
     103    _rollout_regex = re.compile(r'(rolling out|reverting) (?P<revisions>r?\d+((,\s*|,?\s*and\s+)?r?\d+)*)\.?\s*', re.MULTILINE | re.IGNORECASE)
     104    _requested_by_regex = re.compile(r'^\"?(?P<reason>.+?)\"? \(Requested\s+by\s+(?P<author>.+?)\s+on\s+#webkit\)\.', re.MULTILINE | re.IGNORECASE)
    105105    _bugzilla_url_regex = re.compile(r'http(s?)://bugs\.webkit\.org/show_bug\.cgi\?id=(?P<id>\d+)', re.MULTILINE)
    106106    _trac_url_regex = re.compile(r'http(s?)://trac.webkit.org/changeset/(?P<revision>\d+)', re.MULTILINE)
     
    122122            if not contributor.irc_nicknames:
    123123                continue
    124             nickname = contributor.irc_nicknames[0]
    125             commit_log = commit_log.replace(contributor.full_name, nickname)
    126             for email in contributor.emails:
    127                 commit_log = commit_log.replace(email, nickname)
     124            name_with_nick = "%s (%s)" % (contributor.full_name, contributor.irc_nicknames[0])
     125            if contributor.full_name in commit_log:
     126                commit_log = commit_log.replace(contributor.full_name, name_with_nick)
     127                for email in contributor.emails:
     128                    commit_log = commit_log.replace(' <' + email + '>', '')
     129            else:
     130                for email in contributor.emails:
     131                    commit_log = commit_log.replace(email, name_with_nick)
    128132
    129133        lines = commit_log.split('\n')[1:-2]  # Ignore lines with ----------.
    130134
    131         firstline = re.match(r'^(?P<revision>r\d+) \| (?P<email>[^\s\|]+) \| (?P<timestamp>[^|]+) \| [^\n]+', lines[0])
     135        firstline = re.match(r'^(?P<revision>r\d+) \| (?P<email>[^\|]+) \| (?P<timestamp>[^|]+) \| [^\n]+', lines[0])
    132136        assert firstline
    133137        author = firstline.group('email')
     
    140144        if rollout:
    141145            if requested_by:
    142                 return '%s rolled out %s in %s: %s' % (requested_by.group('author'), rollout.group('revisions'),
     146                author = requested_by.group('author')
     147                contributor = committer_list.contributor_by_irc_nickname(author)
     148                if contributor:
     149                    author = "%s (%s)" % (contributor.full_name, contributor.irc_nicknames[0])
     150                return '%s rolled out %s in %s: %s' % (author, rollout.group('revisions'),
    143151                    linkified_revision, requested_by.group('reason'))
    144152            lines[0] = '%s rolled out %s in %s' % (author, rollout.group('revisions'), linkified_revision)
    145153
    146         return '  '.join(filter(lambda line: len(line), lines)[0:4])
     154        return ' '.join(filter(lambda line: len(line), lines)[0:4])
    147155
    148156    def handle_unexpected_error(self, failure_map, message):
  • trunk/Tools/Scripts/webkitpy/tool/commands/newcommitbot_unittest.py

    r143109 r143119  
    4848
    4949------------------------------------------------------------------------"""),
    50             "https://trac.webkit.org/r143106 by jochen__ [chromium] initialize all variables of TestRunner classes"
    51             "  https://webkit.org/b/110013  Reviewed by abarth.")
     50            "https://trac.webkit.org/r143106 by Jochen Eisinger (jochen__) [chromium] initialize all variables of TestRunner classes"
     51            " https://webkit.org/b/110013 Reviewed by Adam Barth (abarth).")
    5252
    5353        self.assertEqual(NewCommitBot._summarize_commit_log("""------------------------------------------------------------------------
     
    6565(WebCore::RenderScrollbarPart::paintIntoRect):
    6666------------------------------------------------------------------------"""),
    67             "https://trac.webkit.org/r140066 by smfr"
    68             "  Allow PaintInfo to carry all PaintBehavior flags  https://webkit.org/b/106980  Reviewed by dethbakin.")
     67            "https://trac.webkit.org/r140066 by Simon Fraser (smfr)"
     68            " Allow PaintInfo to carry all PaintBehavior flags https://webkit.org/b/106980 Reviewed by Beth Dakin (dethbakin).")
    6969
    7070    def test_summarize_commit_log_rollout(self):
     
    8484
    8585------------------------------------------------------------------------"""),
    86             "ggaren rolled out r142734 in https://trac.webkit.org/r143104: Triggered crashes on lots of websites")
     86            "Geoffrey Garen (ggaren) rolled out r142734 in https://trac.webkit.org/r143104: Triggered crashes on lots of websites")
    8787
    8888        self.assertEqual(NewCommitBot._summarize_commit_log("""------------------------------------------------------------------------
     
    101101
    102102------------------------------------------------------------------------"""),
    103             "kov rolled out 139877 in https://trac.webkit.org/r139884"
    104             "  [GStreamer][Soup] Let GStreamer provide the buffer data is downloaded to, to avoid copying"
    105             "  https://webkit.org/b/105552  It made a couple of API tests fail.")
     103            "Gustavo Noronha Silva (kov) rolled out 139877 in https://trac.webkit.org/r139884"
     104            " [GStreamer][Soup] Let GStreamer provide the buffer data is downloaded to, to avoid copying"
     105            " https://webkit.org/b/105552 It made a couple of API tests fail.")
    106106
    107107        self.assertEqual(NewCommitBot._summarize_commit_log("""------------------------------------------------------------------------
     
    126126
    127127------------------------------------------------------------------------"""),
    128             "vsevik rolled out r134927 and r134944 in https://trac.webkit.org/r135487: Reverting the reverts after merging.")
     128            "Vsevolod Vlasov (vsevik) rolled out r134927 and r134944 in https://trac.webkit.org/r135487:"
     129            " Reverting the reverts after merging.")
Note: See TracChangeset for help on using the changeset viewer.