[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

eric at webkit.org eric at webkit.org
Thu Apr 8 00:53:18 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 8f6c917ae9107a2cdad26840933c1a10fadd4b62
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Jan 4 10:57:03 2010 +0000

    2010-01-04  Eric Seidel  <eric at webkit.org>
    
            Reviewed by Adam Barth.
    
            Need support for longer text in per-command help
            https://bugs.webkit.org/show_bug.cgi?id=33143
    
            Add some minimal additional help to land-diff and
            pave the way for adding better help to all commands.
    
            * Scripts/webkitpy/commands/download.py: Add small amount of additional help to land-diff
            * Scripts/webkitpy/multicommandtool.py: support long_help
            * Scripts/webkitpy/multicommandtool_unittest.py: test long_help
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52725 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 46146d7..676b834 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,17 @@
+2010-01-04  Eric Seidel  <eric at webkit.org>
+
+        Reviewed by Adam Barth.
+
+        Need support for longer text in per-command help
+        https://bugs.webkit.org/show_bug.cgi?id=33143
+
+        Add some minimal additional help to land-diff and
+        pave the way for adding better help to all commands.
+
+        * Scripts/webkitpy/commands/download.py: Add small amount of additional help to land-diff
+        * Scripts/webkitpy/multicommandtool.py: support long_help
+        * Scripts/webkitpy/multicommandtool_unittest.py: test long_help
+
 2010-01-04  Adam Barth  <abarth at webkit.org>
 
         Reviewed by Eric Seidel.
diff --git a/WebKitTools/Scripts/webkitpy/commands/download.py b/WebKitTools/Scripts/webkitpy/commands/download.py
index 13e00fc..d148b27 100644
--- a/WebKitTools/Scripts/webkitpy/commands/download.py
+++ b/WebKitTools/Scripts/webkitpy/commands/download.py
@@ -80,6 +80,9 @@ class LandDiff(AbstractSequencedCommmand):
         steps.Commit,
         steps.CloseBugForLandDiff,
     ]
+    long_help = """land-diff commits the current working copy diff (just as svn or git commit would).
+land-diff will build and run the tests before committing.
+If a bug id is provided, or one can be found in the ChangeLog land-diff will update the bug after committing."""
 
     def _prepare_state(self, options, args, tool):
         return {
diff --git a/WebKitTools/Scripts/webkitpy/multicommandtool.py b/WebKitTools/Scripts/webkitpy/multicommandtool.py
index 15fa88a..a25b150 100644
--- a/WebKitTools/Scripts/webkitpy/multicommandtool.py
+++ b/WebKitTools/Scripts/webkitpy/multicommandtool.py
@@ -42,8 +42,9 @@ from webkitpy.webkit_logging import log
 class Command(object):
     name = None
     show_in_main_help = False
-    def __init__(self, help_text, argument_names=None, options=None, requires_local_commits=False):
+    def __init__(self, help_text, argument_names=None, options=None, long_help=None, requires_local_commits=False):
         self.help_text = help_text
+        self.long_help = long_help
         self.argument_names = argument_names
         self.required_arguments = self._parse_required_arguments(argument_names)
         self.options = options
@@ -112,7 +113,9 @@ class Command(object):
         return self.execute(options, args, tool) or 0
 
     def standalone_help(self):
-        help_text = self.name_with_arguments().ljust(len(self.name_with_arguments()) + 3) + self.help_text + "\n"
+        help_text = self.name_with_arguments().ljust(len(self.name_with_arguments()) + 3) + self.help_text + "\n\n"
+        if self.long_help:
+            help_text += "%s\n\n" % self.long_help
         help_text += self.option_parser.format_option_help(IndentedHelpFormatter())
         return help_text
 
@@ -131,8 +134,9 @@ class Command(object):
 class AbstractDeclarativeCommmand(Command):
     help_text = None
     argument_names = None
+    long_help = None
     def __init__(self, options=None, **kwargs):
-        Command.__init__(self, self.help_text, self.argument_names, options=options, **kwargs)
+        Command.__init__(self, self.help_text, self.argument_names, options=options, long_help=self.long_help, **kwargs)
 
 
 class HelpPrintingOptionParser(OptionParser):
diff --git a/WebKitTools/Scripts/webkitpy/multicommandtool_unittest.py b/WebKitTools/Scripts/webkitpy/multicommandtool_unittest.py
index ea99507..ae77e73 100644
--- a/WebKitTools/Scripts/webkitpy/multicommandtool_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/multicommandtool_unittest.py
@@ -143,9 +143,9 @@ See 'trivial-tool help COMMAND' for more information on a specific command.
 
 
     def test_command_help(self):
-        command_with_options = TrivialCommand(options=[make_option("--my_option")])
+        command_with_options = TrivialCommand(options=[make_option("--my_option")], long_help="LONG HELP")
         tool = TrivialTool(commands=[command_with_options])
-        expected_subcommand_help = "trivial [options]   help text\nOptions:\n  --my_option=MY_OPTION\n\n"
+        expected_subcommand_help = "trivial [options]   help text\n\nLONG HELP\n\nOptions:\n  --my_option=MY_OPTION\n\n"
         self._assert_tool_main_outputs(tool, ["tool", "help", "trivial"], expected_subcommand_help)
 
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list