Changeset 70059 in webkit
- Timestamp:
- Oct 19, 2010 8:21:01 AM (14 years ago)
- Location:
- trunk/WebKitTools
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKitTools/ChangeLog
r70057 r70059 1 2010-10-19 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Eric Seidel. 4 5 webkit-patch stats the filesystem too many times 6 https://bugs.webkit.org/show_bug.cgi?id=47883 7 8 This patch attempts to cache the list of changed files more agressively 9 and to use that list to compute the diff instead of stating the file 10 system again. 11 12 * Scripts/webkitpy/common/checkout/api.py: 13 * Scripts/webkitpy/common/checkout/scm.py: 14 * Scripts/webkitpy/tool/mocktool.py: 15 * Scripts/webkitpy/tool/steps/abstractstep.py: 16 * Scripts/webkitpy/tool/steps/editchangelog.py: 17 * Scripts/webkitpy/tool/steps/preparechangelog.py: 18 1 19 2010-10-19 David Kilzer <ddkilzer@apple.com> 2 20 -
trunk/WebKitTools/Scripts/webkitpy/common/checkout/api.py
r70023 r70059 84 84 return self.commit_info_for_revision(revision).bug_id() 85 85 86 def _modified_files_matching_predicate(self, git_commit, predicate ):86 def _modified_files_matching_predicate(self, git_commit, predicate, changed_files=None): 87 87 # SCM returns paths relative to scm.checkout_root 88 88 # Callers (especially those using the ChangeLog class) may 89 89 # expect absolute paths, so this method returns absolute paths. 90 changed_files = self._scm.changed_files(git_commit) 90 if not changed_files: 91 changed_files = self._scm.changed_files(git_commit) 91 92 absolute_paths = [os.path.join(self._scm.checkout_root, path) for path in changed_files] 92 93 return [path for path in absolute_paths if predicate(path)] 93 94 94 def modified_changelogs(self, git_commit ):95 return self._modified_files_matching_predicate(git_commit, self._is_path_to_changelog )95 def modified_changelogs(self, git_commit, changed_files=None): 96 return self._modified_files_matching_predicate(git_commit, self._is_path_to_changelog, changed_files=changed_files) 96 97 97 def modified_non_changelogs(self, git_commit ):98 return self._modified_files_matching_predicate(git_commit, lambda path: not self._is_path_to_changelog(path) )98 def modified_non_changelogs(self, git_commit, changed_files=None): 99 return self._modified_files_matching_predicate(git_commit, lambda path: not self._is_path_to_changelog(path), changed_files=changed_files) 99 100 100 101 def commit_message_for_this_commit(self, git_commit): -
trunk/WebKitTools/Scripts/webkitpy/common/checkout/scm.py
r70020 r70059 261 261 self._subclass_must_implement() 262 262 263 def create_patch(self, git_commit=None ):263 def create_patch(self, git_commit=None, changed_files=[]): 264 264 self._subclass_must_implement() 265 265 … … 458 458 459 459 # FIXME: This method should be on Checkout. 460 def create_patch(self, git_commit=None ):460 def create_patch(self, git_commit=None, changed_files=[]): 461 461 """Returns a byte array (str()) representing the patch file. 462 462 Patch files are effectively binary since they may contain 463 463 files of multiple different encodings.""" 464 return self.run([self.script_path("svn-create-patch")] ,464 return self.run([self.script_path("svn-create-patch")] + changed_files, 465 465 cwd=self.checkout_root, return_stderr=False, 466 466 decode_output=False) … … 690 690 return "git" 691 691 692 def create_patch(self, git_commit=None ):692 def create_patch(self, git_commit=None, changed_files=[]): 693 693 """Returns a byte array (str()) representing the patch file. 694 694 Patch files are effectively binary since they may contain 695 695 files of multiple different encodings.""" 696 696 # FIXME: This should probably use cwd=self.checkout_root 697 return self.run(['git', 'diff', '--binary', "--no-ext-diff", "--full-index", "-M", self.merge_base(git_commit)] , decode_output=False)697 return self.run(['git', 'diff', '--binary', "--no-ext-diff", "--full-index", "-M", self.merge_base(git_commit)] + changed_files, decode_output=False) 698 698 699 699 @classmethod -
trunk/WebKitTools/Scripts/webkitpy/tool/mocktool.py
r70023 r70059 430 430 self.checkout_root = self.fake_checkout_root 431 431 432 def create_patch(self, git_commit ):432 def create_patch(self, git_commit, changed_files=None): 433 433 return "Patch1" 434 434 … … 476 476 return [self.commit_info_for_revision(32)] 477 477 478 def modified_changelogs(self, git_commit ):478 def modified_changelogs(self, git_commit, changed_files=None): 479 479 # Ideally we'd return something more interesting here. The problem is 480 480 # that LandDiff will try to actually read the patch from disk! -
trunk/WebKitTools/Scripts/webkitpy/tool/steps/abstractstep.py
r69829 r70059 46 46 self._tool.executive.run_and_throw_if_fail(command, quiet) 47 47 48 def _changed_files(self, state): 49 return self.cached_lookup(state, "changed_files") 50 48 51 _well_known_keys = { 49 "diff": lambda self, state: self._tool.scm().create_patch(self._options.git_commit),50 "changelogs": lambda self, state: self._tool.checkout().modified_changelogs(self._options.git_commit),51 52 "bug_title": lambda self, state: self._tool.bugs.fetch_bug(state["bug_id"]).title(), 53 "changed_files": lambda self, state: self._tool.scm().changed_files(self._options.git_commit), 54 "diff": lambda self, state: self._tool.scm().create_patch(self._options.git_commit, changed_files=self._changed_files(state)), 55 "changelogs": lambda self, state: self._tool.checkout().modified_changelogs(self._options.git_commit, changed_files=self._changed_files(state)), 52 56 } 53 57 … … 60 64 return state[key] 61 65 66 def did_modify_checkout(self, state): 67 state["diff"] = None 68 state["changelogs"] = None 69 state["changed_files"] = None 70 62 71 @classmethod 63 72 def options(cls): -
trunk/WebKitTools/Scripts/webkitpy/tool/steps/editchangelog.py
r60384 r70059 36 36 os.chdir(self._tool.scm().checkout_root) 37 37 self._tool.user.edit_changelog(self.cached_lookup(state, "changelogs")) 38 self.did_modify_checkout(state) -
trunk/WebKitTools/Scripts/webkitpy/tool/steps/preparechangelog.py
r69829 r70059 75 75 except ScriptError, e: 76 76 error("Unable to prepare ChangeLogs.") 77 s tate["diff"] = None # We've changed the diff77 self.did_modify_checkout(state)
Note: See TracChangeset
for help on using the changeset viewer.