+2013-02-16 Ryosuke Niwa <rniwa@webkit.org>
+
+ 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:
+
2013-02-16 Ryosuke Niwa <rniwa@webkit.org>
We need a CIA replacement
return range(max(first_new_revision, current_head - 20), current_head + 1)
_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)
- _rollout_regex = re.compile(r'(rolling out|reverting) (?P<revisions>r?\d+((,\s*|,?\s*and\s+)?r?\d+)*)\.?', re.MULTILINE | re.IGNORECASE)
- _requested_by_regex = re.compile(r'^\"?(?P<reason>.+?)\"? \(Requested\s+by\s+(?P<author>.+)\s+on\s+#webkit\)\.', re.MULTILINE | re.IGNORECASE)
+ _rollout_regex = re.compile(r'(rolling out|reverting) (?P<revisions>r?\d+((,\s*|,?\s*and\s+)?r?\d+)*)\.?\s*', re.MULTILINE | re.IGNORECASE)
+ _requested_by_regex = re.compile(r'^\"?(?P<reason>.+?)\"? \(Requested\s+by\s+(?P<author>.+?)\s+on\s+#webkit\)\.', re.MULTILINE | re.IGNORECASE)
_bugzilla_url_regex = re.compile(r'http(s?)://bugs\.webkit\.org/show_bug\.cgi\?id=(?P<id>\d+)', re.MULTILINE)
_trac_url_regex = re.compile(r'http(s?)://trac.webkit.org/changeset/(?P<revision>\d+)', re.MULTILINE)
for contributor in committer_list.contributors():
if not contributor.irc_nicknames:
continue
- nickname = contributor.irc_nicknames[0]
- commit_log = commit_log.replace(contributor.full_name, nickname)
- for email in contributor.emails:
- commit_log = commit_log.replace(email, nickname)
+ name_with_nick = "%s (%s)" % (contributor.full_name, contributor.irc_nicknames[0])
+ if contributor.full_name in commit_log:
+ commit_log = commit_log.replace(contributor.full_name, name_with_nick)
+ for email in contributor.emails:
+ commit_log = commit_log.replace(' <' + email + '>', '')
+ else:
+ for email in contributor.emails:
+ commit_log = commit_log.replace(email, name_with_nick)
lines = commit_log.split('\n')[1:-2] # Ignore lines with ----------.
- firstline = re.match(r'^(?P<revision>r\d+) \| (?P<email>[^\s\|]+) \| (?P<timestamp>[^|]+) \| [^\n]+', lines[0])
+ firstline = re.match(r'^(?P<revision>r\d+) \| (?P<email>[^\|]+) \| (?P<timestamp>[^|]+) \| [^\n]+', lines[0])
assert firstline
author = firstline.group('email')
if patch_by:
if rollout:
if requested_by:
- return '%s rolled out %s in %s: %s' % (requested_by.group('author'), rollout.group('revisions'),
+ author = requested_by.group('author')
+ contributor = committer_list.contributor_by_irc_nickname(author)
+ if contributor:
+ author = "%s (%s)" % (contributor.full_name, contributor.irc_nicknames[0])
+ return '%s rolled out %s in %s: %s' % (author, rollout.group('revisions'),
linkified_revision, requested_by.group('reason'))
lines[0] = '%s rolled out %s in %s' % (author, rollout.group('revisions'), linkified_revision)
- return ' '.join(filter(lambda line: len(line), lines)[0:4])
+ return ' '.join(filter(lambda line: len(line), lines)[0:4])
def handle_unexpected_error(self, failure_map, message):
_log.error(message)
(WebTestRunner::TestRunner::TestRunner):
------------------------------------------------------------------------"""),
- "https://trac.webkit.org/r143106 by jochen__ [chromium] initialize all variables of TestRunner classes"
- " https://webkit.org/b/110013 Reviewed by abarth.")
+ "https://trac.webkit.org/r143106 by Jochen Eisinger (jochen__) [chromium] initialize all variables of TestRunner classes"
+ " https://webkit.org/b/110013 Reviewed by Adam Barth (abarth).")
self.assertEqual(NewCommitBot._summarize_commit_log("""------------------------------------------------------------------------
r140066 | simon.fraser@apple.com | 2013-01-17 16:10:31 -0800 (Thu, 17 Jan 2013) | 10 lines
* rendering/RenderScrollbarPart.cpp:
(WebCore::RenderScrollbarPart::paintIntoRect):
------------------------------------------------------------------------"""),
- "https://trac.webkit.org/r140066 by smfr"
- " Allow PaintInfo to carry all PaintBehavior flags https://webkit.org/b/106980 Reviewed by dethbakin.")
+ "https://trac.webkit.org/r140066 by Simon Fraser (smfr)"
+ " Allow PaintInfo to carry all PaintBehavior flags https://webkit.org/b/106980 Reviewed by Beth Dakin (dethbakin).")
def test_summarize_commit_log_rollout(self):
self.assertEqual(NewCommitBot._summarize_commit_log("""------------------------------------------------------------------------
Source/WebCore:
------------------------------------------------------------------------"""),
- "ggaren rolled out r142734 in https://trac.webkit.org/r143104: Triggered crashes on lots of websites")
+ "Geoffrey Garen (ggaren) rolled out r142734 in https://trac.webkit.org/r143104: Triggered crashes on lots of websites")
self.assertEqual(NewCommitBot._summarize_commit_log("""------------------------------------------------------------------------
r139884 | kov@webkit.org | 2013-01-16 08:26:10 -0800 (Wed, 16 Jan 2013) | 23 lines
(_WebKitWebSrcPrivate):
------------------------------------------------------------------------"""),
- "kov rolled out 139877 in https://trac.webkit.org/r139884"
- " [GStreamer][Soup] Let GStreamer provide the buffer data is downloaded to, to avoid copying"
- " https://webkit.org/b/105552 It made a couple of API tests fail.")
+ "Gustavo Noronha Silva (kov) rolled out 139877 in https://trac.webkit.org/r139884"
+ " [GStreamer][Soup] Let GStreamer provide the buffer data is downloaded to, to avoid copying"
+ " https://webkit.org/b/105552 It made a couple of API tests fail.")
self.assertEqual(NewCommitBot._summarize_commit_log("""------------------------------------------------------------------------
r135487 | commit-queue@webkit.org | 2012-11-22 00:09:25 -0800 (Thu, 22 Nov 2012) | 52 lines
* inspector/front-end/CallStackSidebarPane.js:
------------------------------------------------------------------------"""),
- "vsevik rolled out r134927 and r134944 in https://trac.webkit.org/r135487: Reverting the reverts after merging.")
+ "Vsevolod Vlasov (vsevik) rolled out r134927 and r134944 in https://trac.webkit.org/r135487:"
+ " Reverting the reverts after merging.")