[PATCH] help: treat hg help pattern like hg help patterns

timeless timeless at gmail.com
Sun Oct 18 09:35:53 CDT 2015


There are a dozen cases where this happens. I don't want to add all of the
cases manually.

I'm not as attached to the +es form (it handles "remotebranch"), but I
don't think there's any particular harm in allowing "hg help templat" to
work, we're unlikely to create a command called "templat", and if we create
a command "template", I don't think it matters if people get help for
"templates" instead when they ask for "hg help templat".
On Oct 18, 2015 3:54 AM, "Yuya Nishihara" <yuya at tcha.org> wrote:

> 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.
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20151018/f5647f69/attachment.html>


More information about the Mercurial-devel mailing list