mirror of
https://github.com/facebook/sapling.git
synced 2024-10-11 09:17:30 +03:00
d0cf5aacfa
Summary: This removes Python alias handling so the alias handling is done entirely in Rust. There are some subtle changes - alias using prefix mathcing to ambiguous commands will not show other aliases. Hopefully that won't be a big issue. Users can always avoid prefix matching in alias to solve the issue. Reviewed By: sfilipco Differential Revision: D16733270 fbshipit-source-id: 54a4915d49c2b2f6e8664a225a9c0f25e1c38d17
59 lines
909 B
Perl
59 lines
909 B
Perl
Alias can override builtin commands.
|
|
|
|
$ newrepo
|
|
$ setconfig alias.log="log -T 'x\n'"
|
|
$ hg log -r null
|
|
x
|
|
|
|
Alias can override a builtin command to another builtin command.
|
|
|
|
$ newrepo
|
|
$ setconfig alias.log=id
|
|
$ hg log -r null
|
|
000000000000 tip
|
|
|
|
Alias can refer to another alias. Order does not matter.
|
|
|
|
$ newrepo
|
|
$ cat >> .hg/hgrc <<EOF
|
|
> [alias]
|
|
> a = b
|
|
> b = log -r null -T 'x\n'
|
|
> c = b
|
|
> EOF
|
|
$ hg a
|
|
x
|
|
$ hg c
|
|
x
|
|
|
|
Alias cannot form a cycle.
|
|
|
|
$ newrepo
|
|
$ cat >> .hg/hgrc << EOF
|
|
> [alias]
|
|
> c = a
|
|
> a = b
|
|
> b = c
|
|
> logwithsuffix = logwithsuff
|
|
> log = log
|
|
> EOF
|
|
|
|
$ hg a
|
|
abort: circular alias: a
|
|
[255]
|
|
$ hg b
|
|
abort: circular alias: b
|
|
[255]
|
|
$ hg c
|
|
abort: circular alias: c
|
|
[255]
|
|
$ hg log -r null -T 'x\n'
|
|
x
|
|
|
|
Prefix matching is disabled in aliases
|
|
|
|
$ hg logwithsuffix
|
|
unknown command 'logwithsuff'
|
|
(use 'hg help' to get help)
|
|
[255]
|