[PATCH 2 of 2 RFC] dispatch: look up command by [<space>:]<cmdname> syntax (PoC)

Yuya Nishihara yuya at tcha.org
Sat Feb 24 07:54:46 EST 2018


On Fri, 23 Feb 2018 13:25:52 +0800, Anton Shestakov wrote:
> On Thu, 22 Feb 2018 23:54:47 +0900
> Yuya Nishihara <yuya at tcha.org> wrote:
> 
> > # HG changeset patch
> > # User Yuya Nishihara <yuya at tcha.org>
> > # Date 1516798904 -32400
> > #      Wed Jan 24 22:01:44 2018 +0900
> > # Node ID cb9e1cad42a9a13f17c4c75d350cd509b08f4a21
> > # Parent  e2030eaec92b1ed12577cbe48cd0495d106818a9
> > dispatch: look up command by [<space>:]<cmdname> syntax (PoC)
> > 
> > This allows us to run the show command without giving up our show alias.
> > The separator ':' is copied from the merge-tools syntax, ":<internal-tool>".
> > 
> >   [alias]
> >   show = log -pvr
> >   work = show:show work
> 
> This syntax looks alright to me as a user, but maybe this should also
> support "internal:foo" form in addition to ":foo", in case people want
> to spell it out, and to be fully compatible syntax-wise with
> merge-tools.

That would conflict with the "internal" extension if we had. That's unlikely
in practice, but I don't want to special-case it.

> My thought is that if somebody asks why not use backslash
> with core commands to avoid aliases (like in bash, e.g. \ls) then we
> can say that this is simply 100% reuse of pre-existing syntax (in
> addition to mentioning namespaces for extensions).

Hmm, nobody would want double backslashes, I suppose.


More information about the Mercurial-devel mailing list