Changeset 56156 in webkit


Ignore:
Timestamp:
Mar 18, 2010 5:47:02 AM (14 years ago)
Author:
eric@webkit.org
Message:

2010-03-18 Eric Seidel <eric@webkit.org>

Reviewed by Adam Barth.

Teach what-broke how to look up reviewer and author Committer objects by name
https://bugs.webkit.org/show_bug.cgi?id=36264

  • Scripts/webkitpy/commands/queries.py:
    • Add committer_by_name lookups for both reviewer and author
    • Improve printing in the cases where lookups fail.
  • Scripts/webkitpy/committers.py:
    • Add committer_by_name
  • Scripts/webkitpy/committers_unittest.py:
    • Test committer_by_name
Location:
trunk/WebKitTools
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r56151 r56156  
     12010-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
    1162010-03-17  Adam Barth  <abarth@webkit.org>
    217
  • trunk/WebKitTools/Scripts/webkitpy/commands/queries.py

    r56137 r56156  
    158158        changelog_entry = changelog_entries[0]
    159159        # FIXME: The commit info dictionary here should probably be its own class?
     160        committer_list = CommitterList()
    160161        return {
    161162            "bug_id" : parse_bug_id(changelog_entry.contents()),
     
    163164            "author_name" : changelog_entry.author_name(),
    164165            "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()),
    165167            "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()),
    166169            "committer_email" : committer_email,
    167             "committer" : CommitterList().committer_by_email(committer_email) if committer_email else None
     170            "committer" : committer_list.committer_by_email(committer_email) if committer_email else None
    168171        }
    169172
     
    172175        print "  %s" % view_source_url(commit_info["revision"])
    173176        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"]
    177180
    178181    def _print_blame_information_for_builder(self, builder_status, name_width):
  • trunk/WebKitTools/Scripts/webkitpy/committers.py

    r56132 r56156  
    263263        return self._committers_by_email
    264264
     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
    265271    def committer_by_email(self, email):
    266272        return self._email_to_committer_map().get(email)
  • trunk/WebKitTools/Scripts/webkitpy/committers_unittest.py

    r52641 r56156  
    4444        self.assertEqual(committer_list.reviewer_by_email('so_two@gmail.com'), reviewer)
    4545
     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
    4651        # Test that the first email is assumed to be the Bugzilla email address (for now)
    4752        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.