Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/debugcommands.py @ 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 | 3f67c56a5fd7 |
children | a24c57f1f5c3 |
comparison
equal
deleted
inserted
replaced
36367:4cd2d1cc2a31 | 36368:d639f60c8eb3 |
---|---|
1239 | 1239 |
1240 # editor | 1240 # editor |
1241 editor = ui.geteditor() | 1241 editor = ui.geteditor() |
1242 editor = util.expandpath(editor) | 1242 editor = util.expandpath(editor) |
1243 editorbin = pycompat.shlexsplit(editor, posix=not pycompat.iswindows)[0] | 1243 editorbin = pycompat.shlexsplit(editor, posix=not pycompat.iswindows)[0] |
1244 if pycompat.iswindows and editorbin[0] == '"' and editorbin[-1] == '"': | |
1245 editorbin = editorbin[1:-1] | |
1244 fm.write('editor', _("checking commit editor... (%s)\n"), editorbin) | 1246 fm.write('editor', _("checking commit editor... (%s)\n"), editorbin) |
1245 cmdpath = util.findexe(editorbin) | 1247 cmdpath = util.findexe(editorbin) |
1246 fm.condwrite(not cmdpath and editor == 'vi', 'vinotfound', | 1248 fm.condwrite(not cmdpath and editor == 'vi', 'vinotfound', |
1247 _(" No commit editor set and can't find %s in PATH\n" | 1249 _(" No commit editor set and can't find %s in PATH\n" |
1248 " (specify a commit editor in your configuration" | 1250 " (specify a commit editor in your configuration" |