Changeset 75769 in webkit
- Timestamp:
- Jan 13, 2011 9:40:18 PM (13 years ago)
- Location:
- trunk/Tools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r75768 r75769 1 2011-01-13 Eric Seidel <eric@webkit.org> 2 3 Reviewed by David Levin. 4 5 webkit-patch suggest-reviewers dies when ChangeLogs are missing 6 https://bugs.webkit.org/show_bug.cgi?id=49158 7 8 This is not the most elegant, but it is a very safe fix to this bug. 9 One advantage of catching ScriptError like this instead of adding a 10 new added_or_modified_files or fixing all changed_files callers 11 to use a more specific change_files variant, is that we catch 12 all kinds of ScriptErrors which might cause our (non-essential) 13 suggest-reviewers code to fail out. This should make passing 14 --suggest-reviewers to webkit-patch upload much more robust 15 and may even make it possible for us to make it default. 16 17 The root of the problem here is that SCM.changed_files includes 18 deleted ChangeLog paths (from moves, etc) which then when we ask 19 SVN/Git for the contents of the file at that revision, the command 20 errors out and Executive.run_command raises a ScriptError. 21 22 In the future we might fix this differently by making all current 23 callers of chagned_files use a more specific method for requesting 24 what types of changes they're interested in (adds, modifies, deletes, etc.) 25 26 * Scripts/webkitpy/common/checkout/api.py: 27 * Scripts/webkitpy/common/checkout/api_unittest.py: 28 1 29 2011-01-13 Dan Bernstein <mitz@apple.com> 2 30 -
trunk/Tools/Scripts/webkitpy/common/checkout/api.py
r75761 r75769 63 63 # FIXME: This gets confused if ChangeLog files are moved, as 64 64 # deletes are still "changed files" per changed_files_for_revision. 65 return [self._latest_entry_for_changelog_at_revision(path, revision) for path in changed_files if self.is_path_to_changelog(path)] 65 # FIXME: For now we hack around this by caching any exceptions 66 # which result from having deleted files included the changed_files list. 67 changelog_entries = [] 68 for path in changed_files: 69 if not self.is_path_to_changelog(path): 70 continue 71 try: 72 changelog_entries.append(self._latest_entry_for_changelog_at_revision(path, revision)) 73 except ScriptError: 74 pass 75 return changelog_entries 66 76 67 77 @memoized -
trunk/Tools/Scripts/webkitpy/common/checkout/api_unittest.py
r75761 r75769 39 39 from webkitpy.common.checkout.scm import detect_scm_system, CommitMessage 40 40 from webkitpy.common.system.outputcapture import OutputCapture 41 from webkitpy.common.system.executive import ScriptError 41 42 from webkitpy.thirdparty.mock import Mock 42 43 … … 139 140 self.assertEqual(entry.contents(), _changelog1entry1) 140 141 142 # FIXME: This tests a hack around our current changed_files handling. 143 # Right now changelog_entries_for_revision tries to fetch deleted files 144 # from revisions, resulting in a ScriptError exception. Test that we 145 # recover from those and still return the other ChangeLog entries. 146 def test_changelog_entries_for_revision(self): 147 scm = Mock() 148 scm.changed_files_for_revision = lambda revision: ['foo/ChangeLog', 'bar/ChangeLog'] 149 checkout = Checkout(scm) 150 151 def mock_latest_entry_for_changelog_at_revision(path, revision): 152 if path == "foo/ChangeLog": 153 return 'foo' 154 raise ScriptError() 155 156 checkout._latest_entry_for_changelog_at_revision = mock_latest_entry_for_changelog_at_revision 157 158 # Even though fetching one of the entries failed, the other should succeed. 159 entries = checkout.changelog_entries_for_revision(1) 160 self.assertEqual(len(entries), 1) 161 self.assertEqual(entries[0], 'foo') 162 141 163 def test_commit_info_for_revision(self): 142 164 scm = Mock()
Note: See TracChangeset
for help on using the changeset viewer.