2018-08-21 21:54:08 +03:00
|
|
|
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
|
2019-08-20 05:24:40 +03:00
|
|
|
abort: circular alias: a
|
2018-08-21 21:54:08 +03:00
|
|
|
[255]
|
|
|
|
$ hg b
|
2019-08-20 05:24:40 +03:00
|
|
|
abort: circular alias: b
|
2018-08-21 21:54:08 +03:00
|
|
|
[255]
|
|
|
|
$ hg c
|
2019-08-20 05:24:40 +03:00
|
|
|
abort: circular alias: c
|
2018-08-21 21:54:08 +03:00
|
|
|
[255]
|
|
|
|
$ hg log -r null -T 'x\n'
|
|
|
|
x
|
2019-08-20 05:24:40 +03:00
|
|
|
|
|
|
|
Prefix matching is disabled in aliases
|
|
|
|
|
2018-08-21 21:54:08 +03:00
|
|
|
$ hg logwithsuffix
|
2019-08-20 05:24:40 +03:00
|
|
|
unknown command 'logwithsuff'
|
|
|
|
(use 'hg help' to get help)
|
2018-08-21 21:54:08 +03:00
|
|
|
[255]
|