Changeset 56601 in webkit
- Timestamp:
- Mar 25, 2010 10:38:47 PM (14 years ago)
- Location:
- trunk/WebKitTools
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKitTools/ChangeLog
r56600 r56601 1 2010-03-25 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Eric Seidel. 4 5 Move modified_changelogs (and friends) from scm to checkout 6 https://bugs.webkit.org/show_bug.cgi?id=36636 7 8 These functions know about ChangeLogs, which is forbidden knowledge in 9 scm.py. 10 11 * Scripts/webkitpy/common/checkout/api.py: 12 * Scripts/webkitpy/common/checkout/changelog.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/preparechangelogforrevert.py: 17 * Scripts/webkitpy/tool/steps/revertrevision.py: 18 * Scripts/webkitpy/tool/steps/updatechangelogswithreviewer.py: 19 * Scripts/webkitpy/tool/steps/validatereviewer.py: 20 1 21 2010-03-25 Adam Barth <abarth@webkit.org> 2 22 -
trunk/WebKitTools/Scripts/webkitpy/common/checkout/api.py
r56600 r56601 29 29 import subprocess 30 30 31 from webkitpy.common.checkout.changelog import ChangeLog, is_path_to_changelog 31 32 from webkitpy.common.checkout.commitinfo import CommitInfo 32 from webkitpy.common.checkout.changelog import ChangeLog33 33 from webkitpy.common.checkout.scm import CommitMessage 34 34 from webkitpy.common.system.executive import Executive, run_command, ScriptError … … 46 46 return CommitInfo.commit_info_for_revision(self._scm, svn_revision) 47 47 48 def modified_changelogs(self): 49 return [path for path in self._scm.changed_files() if is_path_to_changelog(path)] 50 48 51 # FIXME: Requires unit test 49 # FIXME: commit_message_for_this_commit and modified_changelogs don't50 # really belong here. We should have a separate module for51 # handling ChangeLogs.52 52 def commit_message_for_this_commit(self): 53 changelog_paths = self. _scm.modified_changelogs()53 changelog_paths = self.modified_changelogs() 54 54 if not len(changelog_paths): 55 55 raise ScriptError(message="Found no modified ChangeLogs, cannot create a commit message.\n" … … 81 81 82 82 run_command(args, input=curl_process.stdout) 83 84 def apply_reverse_diff(self, revision): 85 self._scm.apply_reverse_diff(revision) 86 87 # Fix any ChangeLogs if necessary. 88 changelog_paths = self.modified_changelogs() 89 if len(changelog_paths): 90 # FIXME: Move _scm.script_path here once we get rid of all the dependencies. 91 run_command([self._scm.script_path('resolve-ChangeLogs')] + changelog_paths) 92 93 conflicts = self._scm.conflicted_files() 94 if len(conflicts): 95 raise ScriptError(message="Failed to apply reverse diff for revision %s because of the following conflicts:\n%s" % (revision, "\n".join(conflicts))) -
trunk/WebKitTools/Scripts/webkitpy/common/checkout/changelog.py
r56544 r56601 43 43 return "http://trac.webkit.org/changeset/%s" % revision_number 44 44 45 # Used by SCM.modified_changelogs()45 # Used by Checkout.modified_changelogs() 46 46 def is_path_to_changelog(path): 47 47 return os.path.basename(path) == "ChangeLog" -
trunk/WebKitTools/Scripts/webkitpy/common/checkout/scm.py
r56600 r56601 33 33 import re 34 34 35 from webkitpy.common.checkout.changelog import ChangeLog, is_path_to_changelog36 35 from webkitpy.common.system.executive import Executive, run_command, ScriptError 37 36 from webkitpy.common.system.user import User … … 140 139 match = re.search(self.commit_success_regexp(), commit_text, re.MULTILINE) 141 140 return match.group('svn_revision') 142 143 # ChangeLog-specific code doesn't really belong in scm.py, but this function is very useful.144 def modified_changelogs(self):145 return [path for path in self.changed_files() if is_path_to_changelog(path)]146 141 147 142 @staticmethod … … 468 463 run_command(['git', 'revert', '--no-commit', git_commit], error_handler=Executive.ignore_error) 469 464 470 # Fix any ChangeLogs if necessary.471 changelog_paths = self.modified_changelogs()472 if len(changelog_paths):473 run_command([self.script_path('resolve-ChangeLogs')] + changelog_paths)474 475 conflicts = self.conflicted_files()476 if len(conflicts):477 raise ScriptError(message="Failed to apply reverse diff for revision %s because of the following conflicts:\n%s" % (revision, "\n".join(conflicts)))478 479 465 def revert_files(self, file_paths): 480 466 run_command(['git', 'checkout', 'HEAD'] + file_paths) -
trunk/WebKitTools/Scripts/webkitpy/tool/mocktool.py
r56600 r56601 359 359 return "49824" 360 360 361 def modified_changelogs(self):362 # Ideally we'd return something more interesting here. The problem is363 # that LandDiff will try to actually read the patch from disk!364 return []365 366 361 367 362 class MockCheckout(object): … … 379 374 }) 380 375 376 def modified_changelogs(self): 377 # Ideally we'd return something more interesting here. The problem is 378 # that LandDiff will try to actually read the patch from disk! 379 return [] 380 381 381 def commit_message_for_this_commit(self): 382 382 return Mock() … … 385 385 pass 386 386 387 def apply_reverse_diff(self, revision): 388 pass 387 389 388 390 class MockUser(object): -
trunk/WebKitTools/Scripts/webkitpy/tool/steps/abstractstep.py
r56544 r56601 51 51 _well_known_keys = { 52 52 "diff" : lambda self: self._tool.scm().create_patch(), 53 "changelogs" : lambda self: self._tool. scm().modified_changelogs(),53 "changelogs" : lambda self: self._tool.checkout().modified_changelogs(), 54 54 } 55 55 -
trunk/WebKitTools/Scripts/webkitpy/tool/steps/preparechangelogforrevert.py
r56510 r56601 37 37 # First, discard the ChangeLog changes from the rollout. 38 38 os.chdir(self._tool.scm().checkout_root) 39 changelog_paths = self._tool. scm().modified_changelogs()39 changelog_paths = self._tool.checkout().modified_changelogs() 40 40 self._tool.scm().revert_files(changelog_paths) 41 41 -
trunk/WebKitTools/Scripts/webkitpy/tool/steps/revertrevision.py
r56497 r56601 32 32 class RevertRevision(AbstractStep): 33 33 def run(self, state): 34 self._tool. scm().apply_reverse_diff(state["revision"])34 self._tool.checkout().apply_reverse_diff(state["revision"]) -
trunk/WebKitTools/Scripts/webkitpy/tool/steps/updatechangelogswithreviewer.py
r56544 r56601 68 68 69 69 os.chdir(self._tool.scm().checkout_root) 70 for changelog_path in self._tool. scm().modified_changelogs():70 for changelog_path in self._tool.checkout().modified_changelogs(): 71 71 ChangeLog(changelog_path).set_reviewer(reviewer) -
trunk/WebKitTools/Scripts/webkitpy/tool/steps/validatereviewer.py
r56589 r56601 40 40 # directory issue more globally. 41 41 os.chdir(self._tool.scm().checkout_root) 42 for changelog_path in self._tool. scm().modified_changelogs():42 for changelog_path in self._tool.checkout().modified_changelogs(): 43 43 changelog_entry = ChangeLog(changelog_path).latest_entry() 44 44 if changelog_entry.reviewer():
Note: See TracChangeset
for help on using the changeset viewer.