equal
deleted
inserted
replaced
9 mycmd = cmd --args |
9 mycmd = cmd --args |
10 ''' |
10 ''' |
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 |
17 class RecursiveCommand(Exception): pass |
18 class RecursiveCommand(Exception): pass |
18 |
19 |
67 def uisetup(ui): |
68 def uisetup(ui): |
68 for cmd, target in ui.configitems('alias'): |
69 for cmd, target in ui.configitems('alias'): |
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 = target.split(' ') |
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) |