Changeset 56156 in webkit
- Timestamp:
- Mar 18, 2010 5:47:02 AM (14 years ago)
- Location:
- trunk/WebKitTools
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKitTools/ChangeLog
r56151 r56156 1 2010-03-18 Eric Seidel <eric@webkit.org> 2 3 Reviewed by Adam Barth. 4 5 Teach what-broke how to look up reviewer and author Committer objects by name 6 https://bugs.webkit.org/show_bug.cgi?id=36264 7 8 * Scripts/webkitpy/commands/queries.py: 9 - Add committer_by_name lookups for both reviewer and author 10 - Improve printing in the cases where lookups fail. 11 * Scripts/webkitpy/committers.py: 12 - Add committer_by_name 13 * Scripts/webkitpy/committers_unittest.py: 14 - Test committer_by_name 15 1 16 2010-03-17 Adam Barth <abarth@webkit.org> 2 17 -
trunk/WebKitTools/Scripts/webkitpy/commands/queries.py
r56137 r56156 158 158 changelog_entry = changelog_entries[0] 159 159 # FIXME: The commit info dictionary here should probably be its own class? 160 committer_list = CommitterList() 160 161 return { 161 162 "bug_id" : parse_bug_id(changelog_entry.contents()), … … 163 164 "author_name" : changelog_entry.author_name(), 164 165 "author_email" : changelog_entry.author_email(), 166 "author" : committer_list.committer_by_email(changelog_entry.author_email()) or committer_list.committer_by_name(changelog_entry.author_name()), 165 167 "reviewer_text" : changelog_entry.reviewer_text(), # FIXME: Eventualy we should return an object here. 168 "reviewer" : committer_list.committer_by_name(changelog_entry.reviewer_text()), 166 169 "committer_email" : committer_email, 167 "committer" : CommitterList().committer_by_email(committer_email) if committer_email else None170 "committer" : committer_list.committer_by_email(committer_email) if committer_email else None 168 171 } 169 172 … … 172 175 print " %s" % view_source_url(commit_info["revision"]) 173 176 print " Bug: %s (%s)" % (commit_info["bug_id"], self.tool.bugs.bug_url_for_bug_id(commit_info["bug_id"])) 174 print " Author: %s <%s>" % (commit_info["author_name"], commit_info["author_email"])175 print " Reviewer: %s" % commit_info["reviewer _text"]176 print " Committer: %s" % commit_info["committer"] 177 print " Author: %s" % commit_info["author"] or ("\"%s\" <%s> %" % (commit_info["author_name"], commit_info["author_email"])) 178 print " Reviewer: %s" % commit_info["reviewer"] or commit_info["reviewer_text"] 179 print " Committer: %s" % commit_info["committer"] or commit_info["committer_email"] 177 180 178 181 def _print_blame_information_for_builder(self, builder_status, name_width): -
trunk/WebKitTools/Scripts/webkitpy/committers.py
r56132 r56156 263 263 return self._committers_by_email 264 264 265 def committer_by_name(self, name): 266 # This could be made into a hash lookup if callers need it to be fast. 267 for committer in self.committers(): 268 if committer.full_name == name: 269 return committer 270 265 271 def committer_by_email(self, email): 266 272 return self._email_to_committer_map().get(email) -
trunk/WebKitTools/Scripts/webkitpy/committers_unittest.py
r52641 r56156 44 44 self.assertEqual(committer_list.reviewer_by_email('so_two@gmail.com'), reviewer) 45 45 46 # Test valid committer and reviewer lookup 47 self.assertEqual(committer_list.committer_by_name("Test One"), committer) 48 self.assertEqual(committer_list.committer_by_name("Test Two"), reviewer) 49 self.assertEqual(committer_list.committer_by_name("Test Three"), None) 50 46 51 # Test that the first email is assumed to be the Bugzilla email address (for now) 47 52 self.assertEqual(committer_list.committer_by_email('two@rad.com').bugzilla_email(), 'two@test.com')
Note: See TracChangeset
for help on using the changeset viewer.