Changeset 143504 in webkit
- Timestamp:
- Feb 20, 2013 2:03:49 PM (11 years ago)
- Location:
- trunk/Tools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r143502 r143504 1 2013-02-20 Tony Chang <tony@chromium.org> 2 3 Parse author names with commas in ChangeLogs 4 https://bugs.webkit.org/show_bug.cgi?id=110356 5 6 Reviewed by Dirk Pranke. 7 8 Paweł's name has a comma in it, which was confusing the ChangeLog parser. 9 10 * Scripts/webkitpy/common/checkout/changelog.py: 11 (ChangeLogEntry): Move name splitting regexp into a constant. 12 (ChangeLogEntry._parse_reviewer_text): Use _split_reviewer_names. 13 (ChangeLogEntry._split_reviewer_names): Rename to be more specific. 14 (ChangeLogEntry._split_author_names_with_emails): Rename to be more specific and require emails. 15 (ChangeLogEntry._parse_author_text): Use _split_author_names_with_emails. 16 * Scripts/webkitpy/common/checkout/changelog_unittest.py: 17 (test_parse_authors): Test case with Paweł's name. 18 1 19 2013-02-15 Dirk Schulze <krit@webkit.org> 2 20 -
trunk/Tools/Scripts/webkitpy/common/checkout/changelog.py
r141829 r143504 105 105 svn_id_regexp = r'git-svn-id: http://svn.webkit.org/repository/webkit/trunk@(?P<svnid>\d+) ' 106 106 107 split_names_regexp = r'\s*(?:,(?:\s+and\s+|&)?|(?:^|\s+)and\s+|&&|[/+&])\s*' 108 107 109 def __init__(self, contents, committer_list=CommitterList(), revision=None): 108 110 self._contents = contents … … 132 134 return None, None 133 135 134 reviewer_list = ChangeLogEntry._split_ contributor_names(reviewer_text)136 reviewer_list = ChangeLogEntry._split_reviewer_names(reviewer_text) 135 137 136 138 # Get rid of "reviewers" like "even though this is just a..." in "Reviewed by Sam Weinig, even though this is just a..." … … 141 143 142 144 @classmethod 143 def _split_contributor_names(cls, text): 144 return re.split(r'\s*(?:,(?:\s+and\s+|&)?|(?:^|\s+)and\s+|&&|[/+&])\s*', text) 145 def _split_reviewer_names(cls, text): 146 return re.split(ChangeLogEntry.split_names_regexp, text) 147 148 @classmethod 149 def _split_author_names_with_emails(cls, text): 150 regex = '>' + ChangeLogEntry.split_names_regexp 151 names = re.split(regex, text) 152 if len(names) > 1: 153 names = [name + ">" for name in names[:-1]] + [names[-1]] 154 return names 145 155 146 156 def _fuzz_match_reviewers(self, reviewers_text_list): … … 160 170 if not text: 161 171 return [] 162 authors = cls._split_ contributor_names(text)172 authors = cls._split_author_names_with_emails(text) 163 173 assert(authors and len(authors) >= 1) 164 174 return [cls._parse_author_name_and_email(author) for author in authors] -
trunk/Tools/Scripts/webkitpy/common/checkout/changelog_unittest.py
r141829 r143504 454 454 self._assert_parse_authors('Adam Barth <abarth@webkit.org> && Benjamin Poulain <bpoulain@apple.com>', 455 455 [('Adam Barth', 'abarth@webkit.org'), ('Benjamin Poulain', 'bpoulain@apple.com')]) 456 self._assert_parse_authors(u'Pawe\u0142 Hajdan, Jr. <phajdan.jr@chromium.org>', 457 [(u'Pawe\u0142 Hajdan, Jr.', u'phajdan.jr@chromium.org')]) 458 self._assert_parse_authors(u'Pawe\u0142 Hajdan, Jr. <phajdan.jr@chromium.org>, Adam Barth <abarth@webkit.org>', 459 [(u'Pawe\u0142 Hajdan, Jr.', u'phajdan.jr@chromium.org'), (u'Adam Barth', u'abarth@webkit.org')]) 456 460 457 461 def _assert_has_valid_reviewer(self, reviewer_line, expected):
Note: See TracChangeset
for help on using the changeset viewer.