[PATCH] path information on --version

Lalo Martins lalo.martins at gmail.com
Sun May 28 08:30:32 BST 2006


A few days ago, I had to debug a problem with two conflicting bzr installs
on the same machine (native windows and cygwin).  So I suggested on #bzr
that we should print paths to things like the python interpreter, the
python standard library, and bzrlib, somewhere.  I suggested a new
builtin, someone else (maybe myself) said on --version.  I also thought it
would be optional, but Rob said there's no point, this should just be
always output in --version.  So here it is, enjoy.

=== modified file 'bzrlib/builtins.py'
--- bzrlib/builtins.py	
+++ bzrlib/builtins.py	
@@ -1858,6 +1858,18 @@
         print "  nick: %s" % (branch.nick,)
         if rh:
             print "  revid: %s" % (rh[-1],)
+    print "Using python interpreter:", sys.executable
+    import site
+    print "Using python standard library:", os.path.dirname(site.__file__)
+    print "Using bzrlib:",
+    if len(bzrlib.__path__) > 1:
+        # print repr, which is a good enough way of making it clear it's
+        # more than one element (eg ['/foo/bar', '/foo/bzr'])
+        print repr(bzrlib.__path__)
+    else:
+        print bzrlib.__path__[0]
+
+    print
     print bzrlib.__copyright__
     print "http://bazaar-vcs.org/"
     print


best,
                                               Lalo Martins
--
      So many of our dreams at first seem impossible,
       then they seem improbable, and then, when we
       summon the will, they soon become inevitable.
--
personal:                              http://www.laranja.org/
technical:                    http://lalo.revisioncontrol.net/
GNU: never give up freedom                 http://www.gnu.org/






More information about the bazaar mailing list