# HG changeset patch # User Matt Mackall # Date 1415055392 21600 # Node ID b8f6d840d3eca36ac163aa758c673f1bac2c9a00 # Parent 733d980b9c59dcfecdfbc18a9f53a59e2bd9247f# Parent 72a89cf86fcd78dfa500031b5734147e6b830fbc merge with stable diff -r 733d980b9c59 -r b8f6d840d3ec hgext/extdiff.py --- a/hgext/extdiff.py Sun Nov 02 15:27:15 2014 -0500 +++ b/hgext/extdiff.py Mon Nov 03 16:56:32 2014 -0600 @@ -120,7 +120,7 @@ revs = opts.get('rev') change = opts.get('change') - args = ' '.join(diffopts) + args = ' '.join(map(util.shellquote, diffopts)) do3way = '$parent2' in args if revs and change: @@ -281,8 +281,7 @@ path = util.findexe(cmd) if path is None: path = filemerge.findexternaltool(ui, cmd) or cmd - diffopts = ui.config('extdiff', 'opts.' + cmd, '') - diffopts = diffopts and [diffopts] or [] + diffopts = shlex.split(ui.config('extdiff', 'opts.' + cmd, '')) elif cmd.startswith('opts.'): continue else: diff -r 733d980b9c59 -r b8f6d840d3ec mercurial/commands.py --- a/mercurial/commands.py Sun Nov 02 15:27:15 2014 -0500 +++ b/mercurial/commands.py Mon Nov 03 16:56:32 2014 -0600 @@ -5477,7 +5477,7 @@ [('A', 'accesslog', '', _('name of access log file to write to'), _('FILE')), ('d', 'daemon', None, _('run server in background')), - ('', 'daemon-pipefds', '', _('used internally by daemon mode'), _('NUM')), + ('', 'daemon-pipefds', '', _('used internally by daemon mode'), _('FILE')), ('E', 'errorlog', '', _('name of error log file to write to'), _('FILE')), # use string type, then we can check if something was passed ('p', 'port', '', _('port to listen on (default: 8000)'), _('PORT')), diff -r 733d980b9c59 -r b8f6d840d3ec tests/test-extdiff.t --- a/tests/test-extdiff.t Sun Nov 02 15:27:15 2014 -0500 +++ b/tests/test-extdiff.t Mon Nov 03 16:56:32 2014 -0600 @@ -19,6 +19,8 @@ $ echo "[extdiff]" >> $HGRCPATH $ echo "cmd.falabala=echo" >> $HGRCPATH $ echo "opts.falabala=diffing" >> $HGRCPATH + $ echo "cmd.edspace=echo" >> $HGRCPATH + $ echo 'opts.edspace="name "' >> $HGRCPATH $ hg falabala diffing a.000000000000 a @@ -168,6 +170,16 @@ diffing this */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) [1] +Test extdiff's handling of options with spaces in them: + + $ hg edspace -c 1 + name */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) + [1] + + $ hg extdiff -p echo -o "name " -c 1 + name */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) + [1] + Test with revsets: $ hg extdif -p echo -c "rev(1)"