[PATCH 3 of 3] debuginstall: add Python executable path to debuginstall output (issue4128)

Chris Jerdonek chris.jerdonek at gmail.com
Fri Dec 27 19:20:02 CST 2013


# HG changeset patch
# User Chris Jerdonek <chris.jerdonek at gmail.com>
# Date 1388193253 28800
#      Fri Dec 27 17:14:13 2013 -0800
# Node ID d4f6748d92ddb19b25366c1978f71f83638823fb
# Parent  d302be444d44b4ebfee0bb772ed1988bae2e58e0
debuginstall: add Python executable path to debuginstall output (issue4128)

This change adds the path to the Python executable being used by Mercurial
(i.e. the value of sys.executable) to the output of "hg debuginstall".

Below is an example of what the new output looks like after this change.
The marked line is the new output line:

    $ hg debuginstall
    displaying install info...
 -->sys.executable: '/Users/chris/dev/.virtualenvs/default/bin/python'
    sys.version: 2.7.6 (default, Nov 12 2013, 13:26:39)
    [GCC 4.2.1 Compatible Apple Clang 4.1 ((tags/Apple/clang-421.11.66))]

    checking encoding (UTF-8)...
    checking Python lib (/Users/chris/dev/.virtualenvs/default/lib/
      python2.7)...
    checking installed modules (/Users/chris/dev/mercurial)...
    checking templates (/Users/chris/dev/mercurial/templates)...
    checking commit editor...
    checking username...
    no problems detected

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -2047,6 +2047,7 @@
         return name
 
     ui.status(_("displaying install info...\n"))
+    ui.status(_("sys.executable: %r\n") % sys.executable)
     ui.status(_("sys.version: %s\n\n") % sys.version)
 
     problems = 0
diff --git a/tests/test-debuginstall.py b/tests/test-debuginstall.py
--- a/tests/test-debuginstall.py
+++ b/tests/test-debuginstall.py
@@ -51,10 +51,11 @@
         # before doing the substitution.
         expected = textwrap.dedent("""\
         displaying install info...
+        sys.executable: %r
         sys.version: %s
 
         checking encoding (ascii)...
-        """) % sys.version
+        """) % (sys.executable, sys.version)
         self.checklines(lines, expected.splitlines())
         expected = tolines("""\
         checking Python lib (*lib*)...


More information about the Mercurial-devel mailing list