# HG changeset patch # User Yuya Nishihara # Date 2018-02-17 04:13:04 # Node ID 94a1ff16f3620fdf38e4dc3a10d0bf762741d101 # Parent 548316560a05bb639ec7eb3747dd1fb58c982377 debuginstall: do not parse editor command in posix way on Windows An editor command is executed by a system shell, which is cmd.exe on Windows. diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py --- a/mercurial/debugcommands.py +++ b/mercurial/debugcommands.py @@ -1240,7 +1240,7 @@ def debuginstall(ui, **opts): # editor editor = ui.geteditor() editor = util.expandpath(editor) - editorbin = pycompat.shlexsplit(editor)[0] + editorbin = pycompat.shlexsplit(editor, posix=not pycompat.iswindows)[0] fm.write('editor', _("checking commit editor... (%s)\n"), editorbin) cmdpath = util.findexe(editorbin) fm.condwrite(not cmdpath and editor == 'vi', 'vinotfound', diff --git a/tests/test-install.t b/tests/test-install.t --- a/tests/test-install.t +++ b/tests/test-install.t @@ -140,8 +140,10 @@ not found (this is intentionally using b checking "re2" regexp engine \((available|missing)\) (re) checking templates (*mercurial?templates)... (glob) checking default template (*mercurial?templates?map-cmdline.default) (glob) - checking commit editor... (c:foobarbaz.exe) - Can't find editor 'c:foobarbaz.exe' in PATH + checking commit editor... (c:\foo\bar\baz.exe) (windows !) + Can't find editor 'c:\foo\bar\baz.exe' in PATH (windows !) + checking commit editor... (c:foobarbaz.exe) (no-windows !) + Can't find editor 'c:foobarbaz.exe' in PATH (no-windows !) (specify a commit editor in your configuration file) checking username (test) 1 problems detected, please check your install!