Show More
@@ -11,7 +11,6 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 |
|
|||
15 |
|
14 | |||
16 | cmdtable = {} |
|
15 | cmdtable = {} | |
17 |
|
16 | |||
@@ -70,11 +69,12 b' def uisetup(ui):' | |||||
70 | if not target: |
|
69 | if not target: | |
71 | ui.warn(_('*** [alias] %s: no definition\n') % cmd) |
|
70 | ui.warn(_('*** [alias] %s: no definition\n') % cmd) | |
72 | continue |
|
71 | continue | |
73 |
args = |
|
72 | args = target.split(' ', 1) | |
74 | tcmd = args.pop(0) |
|
73 | tcmd = args.pop(0) | |
75 | if args: |
|
74 | if args: | |
|
75 | args = args[0] | |||
76 | defaults = ui.config('defaults', cmd) |
|
76 | defaults = ui.config('defaults', cmd) | |
77 | if defaults: |
|
77 | if defaults: | |
78 |
args = |
|
78 | args = ' '.join((args, defaults)) | |
79 |
ui.setconfig('defaults', cmd, |
|
79 | ui.setconfig('defaults', cmd, args) | |
80 | cmdtable[cmd] = lazycommand(ui, cmd, tcmd) |
|
80 | cmdtable[cmd] = lazycommand(ui, cmd, tcmd) |
@@ -12,6 +12,7 b' ambiguous = s' | |||||
12 | recursive = recursive |
|
12 | recursive = recursive | |
13 | mylog = log |
|
13 | mylog = log | |
14 | lognull = log -r null |
|
14 | lognull = log -r null | |
|
15 | shortlog = log --template '{rev} {node|short} | {date|isodate}\n' | |||
15 |
|
16 | |||
16 | [defaults] |
|
17 | [defaults] | |
17 | mylog = -q |
|
18 | mylog = -q | |
@@ -38,6 +39,9 b' hg ci -Amfoo' | |||||
38 | echo '% with opts' |
|
39 | echo '% with opts' | |
39 | hg cleanst |
|
40 | hg cleanst | |
40 |
|
41 | |||
|
42 | echo '% with opts and whitespace' | |||
|
43 | hg shortlog | |||
|
44 | ||||
41 | echo '% interaction with defaults' |
|
45 | echo '% interaction with defaults' | |
42 | hg mylog |
|
46 | hg mylog | |
43 | hg lognull |
|
47 | hg lognull |
General Comments 0
You need to be logged in to leave comments.
Login now