# HG changeset patch # User Benoit Boissinot # Date 1242735247 -7200 # Node ID 5fbee915ea5dc83bac5a7dab80ae723ece37c911 # Parent 3f4f14eab0854a9aa9879764b84118bff568b8f5 alias: a0104303f400 did not correctly handle whitespace in the args diff -r 3f4f14eab085 -r 5fbee915ea5d hgext/alias.py --- a/hgext/alias.py Tue May 19 03:59:58 2009 +0200 +++ b/hgext/alias.py Tue May 19 14:14:07 2009 +0200 @@ -11,7 +11,6 @@ from mercurial.i18n import _ from mercurial import commands, cmdutil, error -import shlex cmdtable = {} @@ -70,11 +69,12 @@ if not target: ui.warn(_('*** [alias] %s: no definition\n') % cmd) continue - args = shlex.split(target) + args = target.split(' ', 1) tcmd = args.pop(0) if args: + args = args[0] defaults = ui.config('defaults', cmd) if defaults: - args = shlex.split(defaults) + args - ui.setconfig('defaults', cmd, ' '.join(args)) + args = ' '.join((args, defaults)) + ui.setconfig('defaults', cmd, args) cmdtable[cmd] = lazycommand(ui, cmd, tcmd) diff -r 3f4f14eab085 -r 5fbee915ea5d tests/test-alias --- a/tests/test-alias Tue May 19 03:59:58 2009 +0200 +++ b/tests/test-alias Tue May 19 14:14:07 2009 +0200 @@ -12,6 +12,7 @@ recursive = recursive mylog = log lognull = log -r null +shortlog = log --template '{rev} {node|short} | {date|isodate}\n' [defaults] mylog = -q @@ -38,6 +39,9 @@ echo '% with opts' hg cleanst +echo '% with opts and whitespace' +hg shortlog + echo '% interaction with defaults' hg mylog hg lognull diff -r 3f4f14eab085 -r 5fbee915ea5d tests/test-alias.out --- a/tests/test-alias.out Tue May 19 03:59:58 2009 +0200 +++ b/tests/test-alias.out Tue May 19 14:14:07 2009 +0200 @@ -8,6 +8,8 @@ adding foo % with opts C foo +% with opts and whitespace +0 e63c23eaa88a | 1970-01-01 00:00 +0000 % interaction with defaults 0:e63c23eaa88a -1:000000000000