[PATCH 1 of 2 STABLE] tests: demonstrate `hg show` mapping to showconfig

Yuya Nishihara yuya at tcha.org
Sat Apr 29 10:16:13 EDT 2017


On Fri, 28 Apr 2017 19:24:42 -0700, Gregory Szorc wrote:
> On Fri, Apr 28, 2017 at 4:04 PM, Yuya Nishihara <yuya at tcha.org> wrote:
> > On Fri, 28 Apr 2017 10:30:00 -0700, Gregory Szorc wrote:
> > > On Fri, Apr 28, 2017 at 6:04 AM, Yuya Nishihara <yuya at tcha.org> wrote:
> > > > On Thu, 27 Apr 2017 16:11:34 -0700, Gregory Szorc wrote:
> > > > > This series is a "pick your poison" if you are a reviewer. I'm
> > partial to
> > > > > the more complex one adding an argument to @command. But it may not
> > be
> > > > > appropriate for stable. So a hacky fallback is provided as an
> > > > alternative.
> > > >
> > > > I don't think either of them is good for stable. show is highly
> > > > experimental
> > > > extension, right?
> > > >
> > > > That said, the safest hack I can think of is adding null show command
> > to
> > > > the default command table, and wrap it by the show extension.
> > > >
> > >
> > > Oh, I forgot to mention in the commit message that this was the first
> > thing
> > > I did. It resulted in "show" appearing in help output, debugcomplete,
> > etc.
> > > Unless I was doing it wrong, I thought this was worse than hacking alias
> > > resolution due to having user-visible side-effects.
> >
> > Have you tried a command with no docstring (or "(EXPERIMENTAL)") ? I think
> > the help issue can be addressed by that.
> >
> 
> No docstring displays "(no help text available)" in help.

Right. I got why I couldn't see it. My 'show' alias hid it.

> Docstring of "(EXPERIMENTAL)" renders an entry in hgweb's help. (This
> smells like a bug since help's CLI output doesn't change.)

Yeah, it must be a bug.

> show also appears in debugcomplete.
> 
> In both cases, we get a bunch of "extension 'show' overrides commands:
> show" warnings all over the place if we only do a simple @command in
> commands.py without hacking around the command table in show.py.

We'll have to use wrapcommand() instead.

It seems keeping the show being extension causes troubles. We could add
a hack to reserve the command name, but I don't think that's what the core
should have to do.

So, how about moving show to the core in 4.3? Still it can be marked as
an EXPERIMENTAL command.


More information about the Mercurial-devel mailing list