Changeset 57572 in webkit


Ignore:
Timestamp:
Apr 14, 2010 2:00:58 AM (14 years ago)
Author:
eric@webkit.org
Message:

2010-04-14 Eric Seidel <eric@webkit.org>

Reviewed by Adam Barth.

Teach webkit-patch how to handle revisions missing ChangeLogs
https://bugs.webkit.org/show_bug.cgi?id=37519

Make commit_info_for_revision return None when revision
is missing a ChangeLog. Previously we would throw an array index
exception.
Teach callers how to handle None.

  • Scripts/webkitpy/common/checkout/api.py:
  • Scripts/webkitpy/common/checkout/api_unittest.py:
  • Scripts/webkitpy/tool/commands/download.py:
  • Scripts/webkitpy/tool/commands/queries.py:
  • Scripts/webkitpy/tool/commands/sheriffbot.py:
Location:
trunk/WebKitTools
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r57561 r57572  
     12010-04-14  Eric Seidel  <eric@webkit.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        Teach webkit-patch how to handle revisions missing ChangeLogs
     6        https://bugs.webkit.org/show_bug.cgi?id=37519
     7
     8        Make commit_info_for_revision return None when revision
     9        is missing a ChangeLog.  Previously we would throw an array index
     10        exception.
     11        Teach callers how to handle None.
     12
     13        * Scripts/webkitpy/common/checkout/api.py:
     14        * Scripts/webkitpy/common/checkout/api_unittest.py:
     15        * Scripts/webkitpy/tool/commands/download.py:
     16        * Scripts/webkitpy/tool/commands/queries.py:
     17        * Scripts/webkitpy/tool/commands/sheriffbot.py:
     18
    1192010-04-13  Eric Seidel  <eric@webkit.org>
    220
  • trunk/WebKitTools/Scripts/webkitpy/common/checkout/api.py

    r56993 r57572  
    6262        # Assume for now that the first entry has everything we need:
    6363        # FIXME: This will throw an exception if there were no ChangeLogs.
     64        if not len(changelog_entries):
     65            return None
    6466        changelog_entry = changelog_entries[0]
    6567        changelog_data = {
  • trunk/WebKitTools/Scripts/webkitpy/common/checkout/api_unittest.py

    r56891 r57572  
    145145        self.assertEqual(commitinfo.committer(), None)
    146146
     147        checkout.changelog_entries_for_revision = lambda revision: []
     148        self.assertEqual(checkout.commit_info_for_revision(1), None)
     149
    147150    def test_bug_id_for_revision(self):
    148151        scm = Mock()
  • trunk/WebKitTools/Scripts/webkitpy/tool/commands/download.py

    r56964 r57572  
    255255    def _commit_info(self, revision):
    256256        commit_info = self.tool.checkout().commit_info_for_revision(revision)
    257         if commit_info.bug_id():
     257        if commit_info and commit_info.bug_id():
    258258            # Note: Don't print a bug URL here because it will confuse the
    259259            #       SheriffBot because the SheriffBot just greps the output
  • trunk/WebKitTools/Scripts/webkitpy/tool/commands/queries.py

    r57195 r57572  
    143143        for revision in suspect_revisions:
    144144            commit_info = self.tool.checkout().commit_info_for_revision(revision)
    145             print commit_info.blame_string(self.tool.bugs)
     145            if commit_info:
     146                print commit_info.blame_string(self.tool.bugs)
     147            else:
     148                print "FAILED to fetch CommitInfo for r%s, likely missing ChangeLog" % revision
    146149
    147150    def execute(self, options, args, tool):
     
    202205        for revision in suspect_revisions:
    203206            commit_info = self.tool.checkout().commit_info_for_revision(revision)
    204             print commit_info.blame_string(self.tool.bugs)
     207            if commit_info:
     208                print commit_info.blame_string(self.tool.bugs)
     209            else:
     210                print "FAILED to fetch CommitInfo for r%s, likely missing ChangeLog" % revision
    205211
    206212    def _explain_failures_for_builder(self, builder, start_revision, search_limit=1000):
  • trunk/WebKitTools/Scripts/webkitpy/tool/commands/sheriffbot.py

    r57430 r57572  
    8181            try:
    8282                commit_info = self.tool.checkout().commit_info_for_revision(svn_revision)
     83                if not commit_info:
     84                    print "FAILED to fetch CommitInfo for r%s, likely missing ChangeLog" % revision
     85                    continue
    8386                self._sheriff.post_irc_warning(commit_info, builders)
    8487                self._sheriff.post_blame_comment_on_bug(commit_info,
Note: See TracChangeset for help on using the changeset viewer.