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.
--- a/mercurial/debugcommands.py Sun Feb 18 22:13:25 2018 +0900
+++ b/mercurial/debugcommands.py Sat Feb 17 13:13:04 2018 +0900
@@ -1240,7 +1240,7 @@
# 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',
--- a/tests/test-install.t Sun Feb 18 22:13:25 2018 +0900
+++ b/tests/test-install.t Sat Feb 17 13:13:04 2018 +0900
@@ -140,8 +140,10 @@
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!