changeset 36368:d639f60c8eb3

debuginstall: strip double quotes from editorbin on Windows The unconditional posix style shlex.split() prior to 94a1ff16f362 handled this. This isn't mutually exclusive with stripping the quotes in util.findexe()- if the editor can't be found, this command prints out the string, inside single quotes.
author Matt Harbison <matt_harbison@yahoo.com>
date Tue, 20 Feb 2018 22:03:13 -0500
parents 4cd2d1cc2a31
children 236596a67a54
files mercurial/debugcommands.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/debugcommands.py	Tue Feb 20 21:37:30 2018 -0500
+++ b/mercurial/debugcommands.py	Tue Feb 20 22:03:13 2018 -0500
@@ -1241,6 +1241,8 @@
     editor = ui.geteditor()
     editor = util.expandpath(editor)
     editorbin = pycompat.shlexsplit(editor, posix=not pycompat.iswindows)[0]
+    if pycompat.iswindows and editorbin[0] == '"' and editorbin[-1] == '"':
+        editorbin = editorbin[1:-1]
     fm.write('editor', _("checking commit editor... (%s)\n"), editorbin)
     cmdpath = util.findexe(editorbin)
     fm.condwrite(not cmdpath and editor == 'vi', 'vinotfound',