Changeset 52707 in webkit
- Timestamp:
- Jan 4, 2010 12:13:19 AM (14 years ago)
- Location:
- trunk/WebKitTools
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKitTools/ChangeLog
r52705 r52707 1 2010-01-04 Eric Seidel <eric@webkit.org> 2 3 Reviewed by Adam Barth. 4 5 Make all commands AbstractDeclarativeCommmands instead of direct Command subclasses 6 https://bugs.webkit.org/show_bug.cgi?id=33131 7 8 Evenetually we'll probably roll AbstractDeclarativeCommmand directly into Command 9 but for now we just deploy it everywhere and don't try to fix up the few valid uses 10 of Command. 11 12 * Scripts/webkitpy/commands/download.py: 13 * Scripts/webkitpy/commands/queries.py: 14 * Scripts/webkitpy/commands/upload.py: 15 * Scripts/webkitpy/multicommandtool.py: 16 1 17 2010-01-03 Adam Barth <abarth@webkit.org> 2 18 -
trunk/WebKitTools/Scripts/webkitpy/commands/download.py
r52703 r52707 41 41 from webkitpy.grammar import pluralize 42 42 from webkitpy.webkit_logging import error, log 43 from webkitpy.multicommandtool import AbstractDeclarativeCommmand , Command43 from webkitpy.multicommandtool import AbstractDeclarativeCommmand 44 44 from webkitpy.stepsequence import StepSequence 45 45 … … 246 246 247 247 # FIXME: Make Rollout more declarative. 248 class Rollout( Command):248 class Rollout(AbstractDeclarativeCommmand): 249 249 name = "rollout" 250 250 show_in_main_help = True 251 help_text = "Revert the given revision in the working copy and optionally commit the revert and re-open the original bug" 252 argument_names = "REVISION [BUGID]" 251 253 def __init__(self): 252 254 self._sequence = StepSequence([ … … 257 259 CompleteRollout, 258 260 ]) 259 Command.__init__(self, "Revert the given revision in the working copy and optionally commit the revert and re-open the original bug", "REVISION [BUGID]", options=self._sequence.options())261 AbstractDeclarativeCommmand.__init__(self, self._sequence.options()) 260 262 261 263 @staticmethod -
trunk/WebKitTools/Scripts/webkitpy/commands/queries.py
r52703 r52707 35 35 from webkitpy.committers import CommitterList 36 36 from webkitpy.webkit_logging import log 37 from webkitpy.multicommandtool import Command37 from webkitpy.multicommandtool import AbstractDeclarativeCommmand 38 38 39 39 40 class BugsToCommit( Command):40 class BugsToCommit(AbstractDeclarativeCommmand): 41 41 name = "bugs-to-commit" 42 def __init__(self): 43 Command.__init__(self, "List bugs in the commit-queue") 42 help_text = "List bugs in the commit-queue" 44 43 45 44 def execute(self, options, args, tool): … … 49 48 50 49 51 class PatchesToCommit( Command):50 class PatchesToCommit(AbstractDeclarativeCommmand): 52 51 name = "patches-to-commit" 53 def __init__(self): 54 Command.__init__(self, "List patches in the commit-queue") 52 help_text = "List patches in the commit-queue" 55 53 56 54 def execute(self, options, args, tool): … … 61 59 62 60 63 class PatchesToCommitQueue( Command):61 class PatchesToCommitQueue(AbstractDeclarativeCommmand): 64 62 name = "patches-to-commit-queue" 63 help_text = "Patches which should be added to the commit queue" 65 64 def __init__(self): 66 65 options = [ 67 66 make_option("--bugs", action="store_true", dest="bugs", help="Output bug links instead of patch links"), 68 67 ] 69 Command.__init__(self, "Patches which should be added to the commit queue", options=options)68 AbstractDeclarativeCommmand.__init__(self, options=options) 70 69 71 70 @staticmethod … … 95 94 96 95 97 class PatchesToReview( Command):96 class PatchesToReview(AbstractDeclarativeCommmand): 98 97 name = "patches-to-review" 99 def __init__(self): 100 Command.__init__(self, "List patches that are pending review") 98 help_text = "List patches that are pending review" 101 99 102 100 def execute(self, options, args, tool): … … 107 105 108 106 109 class ReviewedPatches( Command):107 class ReviewedPatches(AbstractDeclarativeCommmand): 110 108 name = "reviewed-patches" 111 def __init__(self):112 Command.__init__(self, "List r+'d patches on a bug", "BUGID")109 help_text = "List r+'d patches on a bug" 110 argument_names = "BUGID" 113 111 114 112 def execute(self, options, args, tool): … … 119 117 120 118 121 class TreeStatus( Command):119 class TreeStatus(AbstractDeclarativeCommmand): 122 120 name = "tree-status" 123 121 show_in_main_help = True 124 def __init__(self): 125 Command.__init__(self, "Print the status of the %s buildbots" % BuildBot.default_host) 122 help_text = "Print the status of the %s buildbots" % BuildBot.default_host 126 123 127 124 def execute(self, options, args, tool): -
trunk/WebKitTools/Scripts/webkitpy/commands/upload.py
r52704 r52707 43 43 from webkitpy.grammar import pluralize 44 44 from webkitpy.webkit_logging import error, log 45 from webkitpy.multicommandtool import Command,AbstractDeclarativeCommmand45 from webkitpy.multicommandtool import AbstractDeclarativeCommmand 46 46 47 47 # FIXME: Requires unit test. 48 class CommitMessageForCurrentDiff( Command):48 class CommitMessageForCurrentDiff(AbstractDeclarativeCommmand): 49 49 name = "commit-message" 50 def __init__(self): 51 Command.__init__(self, "Print a commit message suitable for the uncommitted changes") 50 help_text = "Print a commit message suitable for the uncommitted changes" 52 51 53 52 def execute(self, options, args, tool): … … 172 171 173 172 174 class PostCommits( Command):173 class PostCommits(AbstractDeclarativeCommmand): 175 174 name = "post-commits" 176 175 show_in_main_help = True 176 help_text = "Attach a range of local commits to bugs as patch files" 177 argument_names = "COMMITISH" 178 177 179 def __init__(self): 178 180 options = [ … … 184 186 CommandOptions.request_commit, 185 187 ] 186 Command.__init__(self, "Attach a range of local commits to bugs as patch files", "COMMITISH", options=options, requires_local_commits=True)188 AbstractDeclarativeCommmand.__init__(self, options=options, requires_local_commits=True) 187 189 188 190 def _comment_text_for_commit(self, options, commit_message, tool, commit_id): … … 225 227 226 228 # FIXME: Requires unit test. Blocking issue: too complex for now. 227 class MarkBugFixed( Command):229 class MarkBugFixed(AbstractDeclarativeCommmand): 228 230 name = "mark-bug-fixed" 229 231 show_in_main_help = True 232 help_text = "Mark the specified bug as fixed" 233 argument_names = "[SVN_REVISION]" 230 234 def __init__(self): 231 235 options = [ … … 235 239 make_option("--update-only", action="store_true", default=False, dest="update_only", help="Add comment to the bug, but do not close it."), 236 240 ] 237 Command.__init__(self, "Mark the specified bug as fixed", "[SVN_REVISION]", options=options)241 AbstractDeclarativeCommmand.__init__(self, options=options) 238 242 239 243 def _fetch_commit_log(self, tool, svn_revision): … … 312 316 313 317 # FIXME: Requires unit test. Blocking issue: too complex for now. 314 class CreateBug( Command):318 class CreateBug(AbstractDeclarativeCommmand): 315 319 name = "create-bug" 316 320 show_in_main_help = True 321 help_text = "Create a bug from local changes or local commits" 322 argument_names = "[COMMITISH]" 323 317 324 def __init__(self): 318 325 options = [ … … 323 330 make_option("--request-commit", action="store_true", dest="request_commit", default=False, help="Mark the patch as needing auto-commit after review."), 324 331 ] 325 Command.__init__(self, "Create a bug from local changes or local commits", "[COMMITISH]", options=options)332 AbstractDeclarativeCommmand.__init__(self, options=options) 326 333 327 334 def create_bug_from_commit(self, options, args, tool): -
trunk/WebKitTools/Scripts/webkitpy/multicommandtool.py
r52703 r52707 132 132 help_text = None 133 133 argument_names = None 134 def __init__(self, options=None ):135 Command.__init__(self, self.help_text, self.argument_names, options )134 def __init__(self, options=None, **kwargs): 135 Command.__init__(self, self.help_text, self.argument_names, options=options, **kwargs) 136 136 137 137 … … 156 156 157 157 158 class HelpCommand( Command):158 class HelpCommand(AbstractDeclarativeCommmand): 159 159 name = "help" 160 help_text = "Display information about this program or its subcommands" 161 argument_names = "[COMMAND]" 160 162 161 163 def __init__(self): … … 163 165 make_option("-a", "--all-commands", action="store_true", dest="show_all_commands", help="Print all available commands"), 164 166 ] 165 Command.__init__(self, "Display information about this program or its subcommands", "[COMMAND]", options=options)167 AbstractDeclarativeCommmand.__init__(self, options) 166 168 self.show_all_commands = False # A hack used to pass --all-commands to _help_epilog even though it's called by the OptionParser. 167 169
Note: See TracChangeset
for help on using the changeset viewer.