##// END OF EJS Templates
alias: a0104303f400 did not correctly handle whitespace in the args
Benoit Boissinot -
r8519:5fbee915 default
parent child Browse files
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 = shlex.split(target)
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 = shlex.split(defaults) + args
78 args = ' '.join((args, defaults))
79 ui.setconfig('defaults', cmd, ' '.join(args))
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
@@ -8,6 +8,8 b''
8 adding foo
8 adding foo
9 % with opts
9 % with opts
10 C foo
10 C foo
11 % with opts and whitespace
12 0 e63c23eaa88a | 1970-01-01 00:00 +0000
11 % interaction with defaults
13 % interaction with defaults
12 0:e63c23eaa88a
14 0:e63c23eaa88a
13 -1:000000000000
15 -1:000000000000
General Comments 0
You need to be logged in to leave comments. Login now