Show More
@@ -11,6 +11,7 b' mycmd = cmd --args' | |||||
11 |
|
11 | |||
12 | from mercurial.i18n import _ |
|
12 | from mercurial.i18n import _ | |
13 | from mercurial import commands, cmdutil, error |
|
13 | from mercurial import commands, cmdutil, error | |
|
14 | import shlex | |||
14 |
|
15 | |||
15 | cmdtable = {} |
|
16 | cmdtable = {} | |
16 |
|
17 | |||
@@ -69,8 +70,11 b' def uisetup(ui):' | |||||
69 | if not target: |
|
70 | if not target: | |
70 | ui.warn(_('*** [alias] %s: no definition\n') % cmd) |
|
71 | ui.warn(_('*** [alias] %s: no definition\n') % cmd) | |
71 | continue |
|
72 | continue | |
72 |
args = |
|
73 | args = shlex.split(target) | |
73 | tcmd = args.pop(0) |
|
74 | tcmd = args.pop(0) | |
74 | if args: |
|
75 | if args: | |
|
76 | defaults = ui.config('defaults', cmd) | |||
|
77 | if defaults: | |||
|
78 | args = shlex.split(defaults) + args | |||
75 | ui.setconfig('defaults', cmd, ' '.join(args)) |
|
79 | ui.setconfig('defaults', cmd, ' '.join(args)) | |
76 | cmdtable[cmd] = lazycommand(ui, cmd, tcmd) |
|
80 | cmdtable[cmd] = lazycommand(ui, cmd, tcmd) |
@@ -10,6 +10,13 b' cleanstatus = status -c' | |||||
10 | unknown = bargle |
|
10 | unknown = bargle | |
11 | ambiguous = s |
|
11 | ambiguous = s | |
12 | recursive = recursive |
|
12 | recursive = recursive | |
|
13 | mylog = log | |||
|
14 | lognull = log -r null | |||
|
15 | ||||
|
16 | [defaults] | |||
|
17 | mylog = -q | |||
|
18 | lognull = -q | |||
|
19 | log = -v | |||
13 | EOF |
|
20 | EOF | |
14 |
|
21 | |||
15 | echo '% basic' |
|
22 | echo '% basic' | |
@@ -30,3 +37,7 b' hg ci -Amfoo' | |||||
30 |
|
37 | |||
31 | echo '% with opts' |
|
38 | echo '% with opts' | |
32 | hg cleanst |
|
39 | hg cleanst | |
|
40 | ||||
|
41 | echo '% interaction with defaults' | |||
|
42 | hg mylog | |||
|
43 | hg lognull |
General Comments 0
You need to be logged in to leave comments.
Login now