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

Anton Shestakov av6 at dwimlabs.net
Fri Feb 23 00:25:52 EST 2018


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. 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).


More information about the Mercurial-devel mailing list