Changeset 228303 in webkit
- Timestamp:
- Feb 8, 2018, 5:24:36 PM (9 years ago)
- Location:
- trunk/Tools
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
Scripts/webkitpy/common/checkout/checkout.py (modified) (1 diff)
-
Scripts/webkitpy/common/checkout/checkout_unittest.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r228282 r228303 1 2018-02-08 Jonathan Bedard <jbedard@apple.com> 2 3 webkit-patch suggest-reviewers dies with AttributeError: 'NoneType' object has no attribute 'revision' 4 https://bugs.webkit.org/show_bug.cgi?id=182584 5 6 Reviewed by Daniel Bates. 7 8 It is possible that a specific revision has an empty ChangeLog. In this case, Checkout.commit_info_for_revision 9 will return 'None'. Checkout.recent_commit_infos_for_files should never return a set with 'None' in it. 10 11 * Scripts/webkitpy/common/checkout/checkout.py: 12 (Checkout.recent_commit_infos_for_files): Remove any empty commit information from the set. 13 * Scripts/webkitpy/common/checkout/checkout_unittest.py: Add a file which references an empty ChangeLog. 14 1 15 2018-02-08 Matt Lewis <jlewis3@apple.com> 2 16 -
trunk/Tools/Scripts/webkitpy/common/checkout/checkout.py
r225733 r228303 138 138 def recent_commit_infos_for_files(self, paths): 139 139 revisions = set(sum(map(self._scm.revisions_changing_file, paths), [])) 140 return set(map(self.commit_info_for_revision, revisions)) 140 # Remove a None entry from the set. This can happen if a revision does have an associated ChangeLog entry (e.g. r185745). 141 return set(map(self.commit_info_for_revision, revisions)) - set([None]) 141 142 142 143 def suggested_reviewers(self, git_commit, changed_files=None): -
trunk/Tools/Scripts/webkitpy/common/checkout/checkout_unittest.py
r223177 r228303 419 419 def test_suggested_reviewers(self): 420 420 def mock_changelog_entries_for_revision(revision, changed_files=None): 421 if revision == 27: 422 return [] 421 423 if revision % 2 == 0: 422 424 return [ChangeLogEntry(_changelog1entry1)] … … 424 426 425 427 def mock_revisions_changing_file(path, limit=5): 426 if path.endswith( "ChangeLog"):428 if path.endswith('ChangeLog'): 427 429 return [3] 430 if path.endswith('file_with_empty_changelog'): 431 return [27] 428 432 return [4, 8] 429 433 430 434 checkout = self._make_checkout() 431 checkout._scm.checkout_root = "/foo/bar"432 checkout._scm.changed_files = lambda git_commit: [ "file1", "file2", "relative/path/ChangeLog"]435 checkout._scm.checkout_root = '/foo/bar' 436 checkout._scm.changed_files = lambda git_commit: ['file1', 'file2', 'relative/path/ChangeLog', 'file_with_empty_changelog'] 433 437 checkout._scm.revisions_changing_file = mock_revisions_changing_file 434 438 checkout.changelog_entries_for_revision = mock_changelog_entries_for_revision
Note:
See TracChangeset
for help on using the changeset viewer.