comparison mercurial/commands.py @ 20740:535283a7f5dd

debuginstall: add Python information to debuginstall output (issue4128) This change adds to the output of "hg debuginstall" information about the Python being used by Mercurial. It adds both the path to the Python executable (i.e. the value of sys.executable) and the version of Python (specifically the major, minor, and micro versions). Below is an example of what the output looks like after this change. The marked lines are the new output lines: $ hg debuginstall checking encoding (UTF-8)... -->showing Python executable (/Users/chris/.virtualenvs/default/bin/python) -->showing Python version (2.7.6) checking Python lib (/Users/chris/.virtualenvs/default/lib/python2.7)... checking installed modules (/Users/chris/mercurial)... checking templates (/Users/chris/mercurial/templates)... checking commit editor... checking username... no problems detected Note that we use the word "showing" without an ellipsis for the new lines because, unlike the other lines (except for "Python lib" which will be adjusted in a subsequent commit), no check follows the display of this information.
author Chris Jerdonek <chris.jerdonek@gmail.com>
date Tue, 31 Dec 2013 00:37:16 -0800
parents 2764148aa088
children f1dfef0a9352
comparison
equal deleted inserted replaced
20739:1b4f2399f3c4 20740:535283a7f5dd
7 7
8 from node import hex, bin, nullid, nullrev, short 8 from node import hex, bin, nullid, nullrev, short
9 from lock import release 9 from lock import release
10 from i18n import _ 10 from i18n import _
11 import os, re, difflib, time, tempfile, errno 11 import os, re, difflib, time, tempfile, errno
12 import sys
12 import hg, scmutil, util, revlog, copies, error, bookmarks 13 import hg, scmutil, util, revlog, copies, error, bookmarks
13 import patch, help, encoding, templatekw, discovery 14 import patch, help, encoding, templatekw, discovery
14 import archival, changegroup, cmdutil, hbisect 15 import archival, changegroup, cmdutil, hbisect
15 import sshserver, hgweb, commandserver 16 import sshserver, hgweb, commandserver
16 from hgweb import server as hgweb_server 17 from hgweb import server as hgweb_server
2157 except util.Abort, inst: 2158 except util.Abort, inst:
2158 ui.write(" %s\n" % inst) 2159 ui.write(" %s\n" % inst)
2159 ui.write(_(" (check that your locale is properly set)\n")) 2160 ui.write(_(" (check that your locale is properly set)\n"))
2160 problems += 1 2161 problems += 1
2161 2162
2162 # Python lib 2163 # Python
2164 ui.status(_("showing Python executable (%s)\n") % sys.executable)
2165 ui.status(_("showing Python version (%s)\n")
2166 % ("%s.%s.%s" % sys.version_info[:3]))
2163 ui.status(_("checking Python lib (%s)...\n") 2167 ui.status(_("checking Python lib (%s)...\n")
2164 % os.path.dirname(os.__file__)) 2168 % os.path.dirname(os.__file__))
2165 2169
2166 # compiled modules 2170 # compiled modules
2167 ui.status(_("checking installed modules (%s)...\n") 2171 ui.status(_("checking installed modules (%s)...\n")