debugcommands: print out the editor that was searched for (post shlexsplit)
A user was in #mercurial and had the following settings in their hgrc:
[ui]
editor = C:\home\npp\notepad++.exe -multiInst -nosession
After shlexsplit, the first argument was mangled into C:homenppnotepad++.exe,
which was quite unlikely to exist. It took many back-and-forths to identify
that adding " characters around the exe would fix the issue; we were thinking
that it's because something was incorrectly *not* splitting and adding/moving
the " characters fixed the split boundaries, but when testing afterward it
appears that it's just mangled.
I considered adding an informational if pycompat.iswindows and \ in the string
about this issue, but was worried that might have too many false positives and
did not do so at this time.
Differential Revision: https://phab.mercurial-scm.org/D1808
from __future__ import absolute_import
from mercurial import (
util,
)
# XXX: we should probably offer a devel option to do this in blackbox directly
def getuser():
return b'bob'
def getpid():
return 5000
# mock the date and user apis so the output is always the same
def uisetup(ui):
util.getuser = getuser
util.getpid = getpid