[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.17-1283-gcf603cf
eric at webkit.org
eric at webkit.org
Wed Jan 6 00:16:27 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit ad75137b1304b14ef76d047dd1c961c82d70381f
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Jan 4 08:13:19 2010 +0000
2010-01-04 Eric Seidel <eric at webkit.org>
Reviewed by Adam Barth.
Make all commands AbstractDeclarativeCommmands instead of direct Command subclasses
https://bugs.webkit.org/show_bug.cgi?id=33131
Evenetually we'll probably roll AbstractDeclarativeCommmand directly into Command
but for now we just deploy it everywhere and don't try to fix up the few valid uses
of Command.
* Scripts/webkitpy/commands/download.py:
* Scripts/webkitpy/commands/queries.py:
* Scripts/webkitpy/commands/upload.py:
* Scripts/webkitpy/multicommandtool.py:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52707 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index c720846..26447ed 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,19 @@
+2010-01-04 Eric Seidel <eric at webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Make all commands AbstractDeclarativeCommmands instead of direct Command subclasses
+ https://bugs.webkit.org/show_bug.cgi?id=33131
+
+ Evenetually we'll probably roll AbstractDeclarativeCommmand directly into Command
+ but for now we just deploy it everywhere and don't try to fix up the few valid uses
+ of Command.
+
+ * Scripts/webkitpy/commands/download.py:
+ * Scripts/webkitpy/commands/queries.py:
+ * Scripts/webkitpy/commands/upload.py:
+ * Scripts/webkitpy/multicommandtool.py:
+
2010-01-03 Adam Barth <abarth at webkit.org>
Unreviewed "build" fix. Need to import ScriptError.
diff --git a/WebKitTools/Scripts/webkitpy/commands/download.py b/WebKitTools/Scripts/webkitpy/commands/download.py
index 8d4b2bf..6a402e2 100644
--- a/WebKitTools/Scripts/webkitpy/commands/download.py
+++ b/WebKitTools/Scripts/webkitpy/commands/download.py
@@ -40,7 +40,7 @@ from webkitpy.comments import bug_comment_from_commit_text
from webkitpy.executive import ScriptError
from webkitpy.grammar import pluralize
from webkitpy.webkit_logging import error, log
-from webkitpy.multicommandtool import AbstractDeclarativeCommmand, Command
+from webkitpy.multicommandtool import AbstractDeclarativeCommmand
from webkitpy.stepsequence import StepSequence
@@ -245,9 +245,11 @@ class LandPatches(AbstractPatchLandingCommand, ProcessBugsMixin):
# FIXME: Make Rollout more declarative.
-class Rollout(Command):
+class Rollout(AbstractDeclarativeCommmand):
name = "rollout"
show_in_main_help = True
+ help_text = "Revert the given revision in the working copy and optionally commit the revert and re-open the original bug"
+ argument_names = "REVISION [BUGID]"
def __init__(self):
self._sequence = StepSequence([
CleanWorkingDirectoryStep,
@@ -256,7 +258,7 @@ class Rollout(Command):
PrepareChangeLogForRevertStep,
CompleteRollout,
])
- 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())
+ AbstractDeclarativeCommmand.__init__(self, self._sequence.options())
@staticmethod
def _parse_bug_id_from_revision_diff(tool, revision):
diff --git a/WebKitTools/Scripts/webkitpy/commands/queries.py b/WebKitTools/Scripts/webkitpy/commands/queries.py
index c9577ba..3d5a675 100644
--- a/WebKitTools/Scripts/webkitpy/commands/queries.py
+++ b/WebKitTools/Scripts/webkitpy/commands/queries.py
@@ -34,13 +34,12 @@ from optparse import make_option
from webkitpy.buildbot import BuildBot
from webkitpy.committers import CommitterList
from webkitpy.webkit_logging import log
-from webkitpy.multicommandtool import Command
+from webkitpy.multicommandtool import AbstractDeclarativeCommmand
-class BugsToCommit(Command):
+class BugsToCommit(AbstractDeclarativeCommmand):
name = "bugs-to-commit"
- def __init__(self):
- Command.__init__(self, "List bugs in the commit-queue")
+ help_text = "List bugs in the commit-queue"
def execute(self, options, args, tool):
bug_ids = tool.bugs.queries.fetch_bug_ids_from_commit_queue()
@@ -48,10 +47,9 @@ class BugsToCommit(Command):
print "%s" % bug_id
-class PatchesToCommit(Command):
+class PatchesToCommit(AbstractDeclarativeCommmand):
name = "patches-to-commit"
- def __init__(self):
- Command.__init__(self, "List patches in the commit-queue")
+ help_text = "List patches in the commit-queue"
def execute(self, options, args, tool):
patches = tool.bugs.queries.fetch_patches_from_commit_queue()
@@ -60,13 +58,14 @@ class PatchesToCommit(Command):
print "%s" % patch["url"]
-class PatchesToCommitQueue(Command):
+class PatchesToCommitQueue(AbstractDeclarativeCommmand):
name = "patches-to-commit-queue"
+ help_text = "Patches which should be added to the commit queue"
def __init__(self):
options = [
make_option("--bugs", action="store_true", dest="bugs", help="Output bug links instead of patch links"),
]
- Command.__init__(self, "Patches which should be added to the commit queue", options=options)
+ AbstractDeclarativeCommmand.__init__(self, options=options)
@staticmethod
def _needs_commit_queue(patch):
@@ -94,10 +93,9 @@ class PatchesToCommitQueue(Command):
print "%s" % tool.bugs.attachment_url_for_id(patch["id"], action="edit")
-class PatchesToReview(Command):
+class PatchesToReview(AbstractDeclarativeCommmand):
name = "patches-to-review"
- def __init__(self):
- Command.__init__(self, "List patches that are pending review")
+ help_text = "List patches that are pending review"
def execute(self, options, args, tool):
patch_ids = tool.bugs.queries.fetch_attachment_ids_from_review_queue()
@@ -106,10 +104,10 @@ class PatchesToReview(Command):
print patch_id
-class ReviewedPatches(Command):
+class ReviewedPatches(AbstractDeclarativeCommmand):
name = "reviewed-patches"
- def __init__(self):
- Command.__init__(self, "List r+'d patches on a bug", "BUGID")
+ help_text = "List r+'d patches on a bug"
+ argument_names = "BUGID"
def execute(self, options, args, tool):
bug_id = args[0]
@@ -118,11 +116,10 @@ class ReviewedPatches(Command):
print "%s" % patch["url"]
-class TreeStatus(Command):
+class TreeStatus(AbstractDeclarativeCommmand):
name = "tree-status"
show_in_main_help = True
- def __init__(self):
- Command.__init__(self, "Print the status of the %s buildbots" % BuildBot.default_host)
+ help_text = "Print the status of the %s buildbots" % BuildBot.default_host
def execute(self, options, args, tool):
for builder in tool.buildbot.builder_statuses():
diff --git a/WebKitTools/Scripts/webkitpy/commands/upload.py b/WebKitTools/Scripts/webkitpy/commands/upload.py
index bef9bdb..154fdff 100644
--- a/WebKitTools/Scripts/webkitpy/commands/upload.py
+++ b/WebKitTools/Scripts/webkitpy/commands/upload.py
@@ -42,13 +42,12 @@ from webkitpy.comments import bug_comment_from_svn_revision
from webkitpy.committers import CommitterList
from webkitpy.grammar import pluralize
from webkitpy.webkit_logging import error, log
-from webkitpy.multicommandtool import Command, AbstractDeclarativeCommmand
+from webkitpy.multicommandtool import AbstractDeclarativeCommmand
# FIXME: Requires unit test.
-class CommitMessageForCurrentDiff(Command):
+class CommitMessageForCurrentDiff(AbstractDeclarativeCommmand):
name = "commit-message"
- def __init__(self):
- Command.__init__(self, "Print a commit message suitable for the uncommitted changes")
+ help_text = "Print a commit message suitable for the uncommitted changes"
def execute(self, options, args, tool):
os.chdir(tool.scm().checkout_root)
@@ -171,9 +170,12 @@ class EditChangeLog(AbstractSequencedCommmand):
]
-class PostCommits(Command):
+class PostCommits(AbstractDeclarativeCommmand):
name = "post-commits"
show_in_main_help = True
+ help_text = "Attach a range of local commits to bugs as patch files"
+ argument_names = "COMMITISH"
+
def __init__(self):
options = [
make_option("-b", "--bug-id", action="store", type="string", dest="bug_id", help="Specify bug id if no URL is provided in the commit log."),
@@ -183,7 +185,7 @@ class PostCommits(Command):
CommandOptions.review,
CommandOptions.request_commit,
]
- Command.__init__(self, "Attach a range of local commits to bugs as patch files", "COMMITISH", options=options, requires_local_commits=True)
+ AbstractDeclarativeCommmand.__init__(self, options=options, requires_local_commits=True)
def _comment_text_for_commit(self, options, commit_message, tool, commit_id):
comment_text = None
@@ -224,9 +226,11 @@ class PostCommits(Command):
# FIXME: Requires unit test. Blocking issue: too complex for now.
-class MarkBugFixed(Command):
+class MarkBugFixed(AbstractDeclarativeCommmand):
name = "mark-bug-fixed"
show_in_main_help = True
+ help_text = "Mark the specified bug as fixed"
+ argument_names = "[SVN_REVISION]"
def __init__(self):
options = [
make_option("--bug-id", action="store", type="string", dest="bug_id", help="Specify bug id if no URL is provided in the commit log."),
@@ -234,7 +238,7 @@ class MarkBugFixed(Command):
make_option("--open", action="store_true", default=False, dest="open_bug", help="Open bug in default web browser (Mac only)."),
make_option("--update-only", action="store_true", default=False, dest="update_only", help="Add comment to the bug, but do not close it."),
]
- Command.__init__(self, "Mark the specified bug as fixed", "[SVN_REVISION]", options=options)
+ AbstractDeclarativeCommmand.__init__(self, options=options)
def _fetch_commit_log(self, tool, svn_revision):
if not svn_revision:
@@ -311,9 +315,12 @@ class MarkBugFixed(Command):
# FIXME: Requires unit test. Blocking issue: too complex for now.
-class CreateBug(Command):
+class CreateBug(AbstractDeclarativeCommmand):
name = "create-bug"
show_in_main_help = True
+ help_text = "Create a bug from local changes or local commits"
+ argument_names = "[COMMITISH]"
+
def __init__(self):
options = [
CommandOptions.cc,
@@ -322,7 +329,7 @@ class CreateBug(Command):
make_option("--no-review", action="store_false", dest="review", default=True, help="Do not mark the patch for review."),
make_option("--request-commit", action="store_true", dest="request_commit", default=False, help="Mark the patch as needing auto-commit after review."),
]
- Command.__init__(self, "Create a bug from local changes or local commits", "[COMMITISH]", options=options)
+ AbstractDeclarativeCommmand.__init__(self, options=options)
def create_bug_from_commit(self, options, args, tool):
commit_ids = tool.scm().commit_ids_from_commitish_arguments(args)
diff --git a/WebKitTools/Scripts/webkitpy/multicommandtool.py b/WebKitTools/Scripts/webkitpy/multicommandtool.py
index 5f89852..15fa88a 100644
--- a/WebKitTools/Scripts/webkitpy/multicommandtool.py
+++ b/WebKitTools/Scripts/webkitpy/multicommandtool.py
@@ -131,8 +131,8 @@ class Command(object):
class AbstractDeclarativeCommmand(Command):
help_text = None
argument_names = None
- def __init__(self, options=None):
- Command.__init__(self, self.help_text, self.argument_names, options)
+ def __init__(self, options=None, **kwargs):
+ Command.__init__(self, self.help_text, self.argument_names, options=options, **kwargs)
class HelpPrintingOptionParser(OptionParser):
@@ -155,14 +155,16 @@ class HelpPrintingOptionParser(OptionParser):
return ""
-class HelpCommand(Command):
+class HelpCommand(AbstractDeclarativeCommmand):
name = "help"
+ help_text = "Display information about this program or its subcommands"
+ argument_names = "[COMMAND]"
def __init__(self):
options = [
make_option("-a", "--all-commands", action="store_true", dest="show_all_commands", help="Print all available commands"),
]
- Command.__init__(self, "Display information about this program or its subcommands", "[COMMAND]", options=options)
+ AbstractDeclarativeCommmand.__init__(self, options)
self.show_all_commands = False # A hack used to pass --all-commands to _help_epilog even though it's called by the OptionParser.
def _help_epilog(self):
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list