[PATCH 1 of 2 pager-dispatch-tweaks] help: move rst formatting of help documents into help.py

Yuya Nishihara yuya at tcha.org
Wed Feb 22 09:03:29 EST 2017


On Tue, 21 Feb 2017 16:14:52 -0500, Augie Fackler wrote:
> # HG changeset patch
> # User Augie Fackler <augie at google.com>
> # Date 1487704651 18000
> #      Tue Feb 21 14:17:31 2017 -0500
> # Node ID f489d1ec2070f25a09f571177b97d8284b3b1932
> # Parent  59e69ed81776f0186cb6e6c69f8d7659afab26b7
> help: move rst formatting of help documents into help.py

Nice. Queued with delight, thanks.

> +def formattedhelp(ui, name, keep=None, unknowncmd=False, full=True, **opts):
> +    """get help for a given topic (as a dotted name) as rendered rst
> +
> +    Either returns the rendered help text or raises an exception.
> +    """
> +    if keep is None:
> +        keep = []

[snip]

> +    if 'verbose' in pruned:
> +        keep.append('omitted')
> +    else:
> +        keep.append('notomitted')

Nit: Perhaps it would be better not mutating the list given as an argument.


More information about the Mercurial-devel mailing list