mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 23:38:50 +03:00
debuginstall: handle quoted path for editor (issue4316)
When using an editor path with spaces and options, you can set 'ui.editor' to '"/path to your/editor" -opt' and it works fine but 'hg debuginstall' is complaining about it because it simply splits the editor and tests presence of '"/path'. Now correctly parse 'ui.editor' string by handling quoted path.
This commit is contained in:
parent
888b6892dd
commit
c20b1f5371
@ -8,7 +8,7 @@
|
||||
from node import hex, bin, nullid, nullrev, short
|
||||
from lock import release
|
||||
from i18n import _
|
||||
import os, re, difflib, time, tempfile, errno
|
||||
import os, re, difflib, time, tempfile, errno, shlex
|
||||
import sys
|
||||
import hg, scmutil, util, revlog, copies, error, bookmarks
|
||||
import patch, help, encoding, templatekw, discovery
|
||||
@ -2247,7 +2247,7 @@ def debuginstall(ui):
|
||||
# editor
|
||||
ui.status(_("checking commit editor...\n"))
|
||||
editor = ui.geteditor()
|
||||
cmdpath = util.findexe(editor) or util.findexe(editor.split()[0])
|
||||
cmdpath = util.findexe(shlex.split(editor)[0])
|
||||
if not cmdpath:
|
||||
if editor == 'vi':
|
||||
ui.write(_(" No commit editor set and can't find vi in PATH\n"))
|
||||
|
Loading…
Reference in New Issue
Block a user