diff -r d4a2e0d5d042 -r a8a902d7176e hgext/extdiff.py --- a/hgext/extdiff.py Sat Mar 24 15:09:33 2018 +0900 +++ b/hgext/extdiff.py Sat Mar 24 15:10:51 2018 +0900 @@ -83,6 +83,7 @@ util, ) from mercurial.utils import ( + procutil, stringutil, ) @@ -280,7 +281,7 @@ key = match.group(3) if not do3way and key == 'parent2': return pre - return pre + util.shellquote(replace[key]) + return pre + procutil.shellquote(replace[key]) # Match parent2 first, so 'parent1?' will match both parent1 and parent regex = (br'''(['"]?)([^\s'"$]*)''' @@ -349,7 +350,7 @@ if not program: program = 'diff' option = option or ['-Npru'] - cmdline = ' '.join(map(util.shellquote, [program] + option)) + cmdline = ' '.join(map(procutil.shellquote, [program] + option)) return dodiff(ui, repo, cmdline, pats, opts) class savedcmd(object): @@ -376,7 +377,7 @@ def __call__(self, ui, repo, *pats, **opts): opts = pycompat.byteskwargs(opts) - options = ' '.join(map(util.shellquote, opts['option'])) + options = ' '.join(map(procutil.shellquote, opts['option'])) if options: options = ' ' + options return dodiff(ui, repo, self._cmdline + options, pats, opts) @@ -387,11 +388,11 @@ if cmd.startswith('cmd.'): cmd = cmd[4:] if not path: - path = util.findexe(cmd) + path = procutil.findexe(cmd) if path is None: path = filemerge.findexternaltool(ui, cmd) or cmd diffopts = ui.config('extdiff', 'opts.' + cmd) - cmdline = util.shellquote(path) + cmdline = procutil.shellquote(path) if diffopts: cmdline += ' ' + diffopts elif cmd.startswith('opts.'): @@ -403,10 +404,10 @@ diffopts = len(pycompat.shlexsplit(cmdline)) > 1 else: # case "cmd =" - path = util.findexe(cmd) + path = procutil.findexe(cmd) if path is None: path = filemerge.findexternaltool(ui, cmd) or cmd - cmdline = util.shellquote(path) + cmdline = procutil.shellquote(path) diffopts = False # look for diff arguments in [diff-tools] then [merge-tools] if not diffopts: