[PATCH] help: treat hg help pattern like hg help patterns
Yuya Nishihara
yuya at tcha.org
Sun Oct 18 02:49:03 CDT 2015
On Fri, 16 Oct 2015 14:28:27 -0500, timeless wrote:
> # HG changeset patch
> # User timeless <timeless at mozdev.org>
> # Date 1445023325 14400
> # Fri Oct 16 15:22:05 2015 -0400
> # Node ID dbd326c55e98a081253ad6e6d2d8e453c06115fe
> # Parent e8f1b728591786143174515ea18089db0df4af90
> help: treat hg help pattern like hg help patterns
>
> diff --git a/mercurial/help.py b/mercurial/help.py
> --- a/mercurial/help.py
> +++ b/mercurial/help.py
> @@ -513,12 +513,19 @@
> queries += [helpcmd]
> if not queries:
> queries = (helptopic, helpcmd, helpext, helpextcmd)
> - for f in queries:
> - try:
> - rst = f(name)
> + def findtopic(name, queries):
> + rst = None
> + for f in queries:
> + try:
> + rst = f(name)
> + break
> + except error.UnknownCommand:
> + pass
> + return rst
> + for topic in [name, name + 's', name + 'es']:
Why not add "pattern" to helptable? I don't think "hg help templat" is valid
as long as it doesn't do prefix matching.
More information about the Mercurial-devel
mailing list