Patchwork [1,of,5,command,metadata,resend] cmdutil: better document command()

login
register
mail settings
Submitter Gregory Szorc
Date June 13, 2014, 6:24 p.m.
Message ID <b6aa82933dc87e6e48dc.1402683857@gps-mbp.local>
Download mbox | patch
Permalink /patch/4995/
State Accepted
Headers show

Comments

Gregory Szorc - June 13, 2014, 6:24 p.m.
# HG changeset patch
# User Gregory Szorc <gregory.szorc@gmail.com>
# Date 1399254304 25200
#      Sun May 04 18:45:04 2014 -0700
# Node ID b6aa82933dc87e6e48dc40331d612ff425ae4f66
# Parent  0f73ed6293629f69aa2f01d8940e91faeded49ae
cmdutil: better document command()
Pierre-Yves David - June 20, 2014, 3:31 p.m.
On 06/13/2014 11:24 AM, Gregory Szorc wrote:
> # HG changeset patch
> # User Gregory Szorc <gregory.szorc@gmail.com>
> # Date 1399254304 25200
> #      Sun May 04 18:45:04 2014 -0700
> # Node ID b6aa82933dc87e6e48dc40331d612ff425ae4f66
> # Parent  0f73ed6293629f69aa2f01d8940e91faeded49ae
> cmdutil: better document command()

I would happily push this series (and associated changesets) if 
`test-check-pyflakes.t` was passing.
Pierre-Yves David - June 23, 2014, 10:26 a.m.
On 06/20/2014 08:31 AM, Pierre-Yves David wrote:
>
>
> On 06/13/2014 11:24 AM, Gregory Szorc wrote:
>> # HG changeset patch
>> # User Gregory Szorc <gregory.szorc@gmail.com>
>> # Date 1399254304 25200
>> #      Sun May 04 18:45:04 2014 -0700
>> # Node ID b6aa82933dc87e6e48dc40331d612ff425ae4f66
>> # Parent  0f73ed6293629f69aa2f01d8940e91faeded49ae
>> cmdutil: better document command()
>
> I would happily push this series (and associated changesets) if
> `test-check-pyflakes.t` was passing.

I fixed the handful of unsused import and pushed it to clowncopter, thanks

(queued)

Patch

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -2472,10 +2472,25 @@  def _performrevert(repo, parents, ctx, a
         if f in copied:
             repo.dirstate.copy(copied[f], f)
 
 def command(table):
-    '''returns a function object bound to table which can be used as
-    a decorator for populating table as a command table'''
+    """Returns a function object to be used as a decorator for making commands.
+
+    This function receives a command table as its argument. The table should
+    be a dict.
+
+    The returned function can be used as a decorator for adding commands
+    to that command table. This function accepts multiple arguments to define
+    a command.
+
+    The first argument is the command name.
+
+    The options argument is an iterable of tuples defining command arguments.
+    See ``mercurial.fancyopts.fancyopts()`` for the format of each tuple.
+
+    The synopsis argument defines a short, one line summary of how to use the
+    command. This shows up in the help output.
+    """
 
     def cmd(name, options=(), synopsis=None):
         def decorator(func):
             if synopsis: