changeset 24891:be4915009b09 stable

debuginstall: expand the editor path before searching for it (issue4380) The editor launches without expanding the path with commits because the shell does that for us. If the path isn't an executable, the expanded path is displayed, which is probably more useful than the unexpanded path. For example, in cmd.exe, '~' expands to C:\Users\$user. But it expands to C:/mingw/msys/1.0/home/$user in MinGW.
author Matt Harbison <matt_harbison@yahoo.com>
date Thu, 30 Apr 2015 23:02:52 -0400
parents cba84b06b702
children 8cc6036bca53
files mercurial/commands.py tests/test-install.t
diffstat 2 files changed, 18 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Fri May 01 22:19:20 2015 +0900
+++ b/mercurial/commands.py	Thu Apr 30 23:02:52 2015 -0400
@@ -2370,6 +2370,7 @@
     # editor
     ui.status(_("checking commit editor...\n"))
     editor = ui.geteditor()
+    editor = util.expandpath(editor)
     cmdpath = util.findexe(shlex.split(editor)[0])
     if not cmdpath:
         if editor == 'vi':
--- a/tests/test-install.t	Fri May 01 22:19:20 2015 +0900
+++ b/tests/test-install.t	Thu Apr 30 23:02:52 2015 -0400
@@ -24,3 +24,20 @@
    (specify a username in your configuration file)
   1 problems detected, please check your install!
   [1]
+
+path variables are expanded (~ is the same as $TESTTMP)
+  $ mkdir tools
+  $ touch tools/testeditor.exe
+#if execbit
+  $ chmod 755 tools/testeditor.exe
+#endif
+  $ hg debuginstall --config ui.editor=~/tools/testeditor.exe
+  checking encoding (ascii)...
+  checking Python executable (*) (glob)
+  checking Python version (*) (glob)
+  checking Python lib (*lib*)... (glob)
+  checking installed modules (*mercurial)... (glob)
+  checking templates (*mercurial?templates)... (glob)
+  checking commit editor...
+  checking username...
+  no problems detected