[PATCH] extensions: allow replacing command synopsis

Augie Fackler raf at durin42.com
Wed Feb 11 08:37:17 CST 2015


On Feb 10, 2015, at 10:43 PM, Ryan McElroy <rm at fb.com> wrote:

> # HG changeset patch
> # User Ryan McElroy <rm at fb.com>
> # Date 1423508565 28800
> #      Mon Feb 09 11:02:45 2015 -0800
> # Node ID dac1fbb56786c2033e188e7b762a9429cd7ff621
> # Parent  ff5caa8dfd993680d9602ca6ebb14da9de10d5f4
> extensions: allow replacing command synopsis

Hm, interesting. Can you give a sample reason why we should support this?

> 
> diff --git a/mercurial/extensions.py b/mercurial/extensions.py
> --- a/mercurial/extensions.py
> +++ b/mercurial/extensions.py
> @@ -152,7 +152,7 @@ def afterloaded(extension, callback):
>     else:
>         _aftercallbacks.setdefault(extension, []).append(callback)
> 
> -def wrapcommand(table, command, wrapper):
> +def wrapcommand(table, command, wrapper, synopsis=None):
>     '''Wrap the command named `command' in table
> 
>     Replace command in the command table with wrapper. The wrapped command will
> @@ -182,6 +182,8 @@ def wrapcommand(table, command, wrapper)
> 
>     newentry = list(entry)
>     newentry[0] = wrap
> +    if synopsis is not None:
> +        newentry[2] = synopsis
>     table[key] = tuple(newentry)
>     return entry
> 
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20150211/f9b9fbc8/attachment.pgp>


More information about the Mercurial-devel mailing list