Rev 2607: Show bzr version, python version, etc when running tests in http://sourcefrog.net/bzr/test-cleanup
Martin Pool
mbp at sourcefrog.net
Thu Jul 12 11:12:52 BST 2007
At http://sourcefrog.net/bzr/test-cleanup
------------------------------------------------------------
revno: 2607
revision-id: mbp at sourcefrog.net-20070712101250-yvle0aj6ro1ww707
parent: pqm at pqm.ubuntu.com-20070712094937-rw5qbi81enh0pvhw
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: test-cleanup
timestamp: Thu 2007-07-12 20:12:50 +1000
message:
Show bzr version, python version, etc when running tests
modified:
bzrlib/builtins.py builtins.py-20050830033751-fc01482b9ca23183
bzrlib/version.py version.py-20060816024207-ves6ult9a11taj9t-1
=== modified file 'bzrlib/builtins.py'
--- a/bzrlib/builtins.py 2007-07-12 09:49:37 +0000
+++ b/bzrlib/builtins.py 2007-07-12 10:12:50 +0000
@@ -2476,11 +2476,11 @@
from bzrlib.tests import selftest
import bzrlib.benchmarks as benchmarks
from bzrlib.benchmarks import tree_creator
+ from bzrlib.version import show_version
if cache_dir is not None:
tree_creator.TreeCreator.CACHE_ROOT = osutils.abspath(cache_dir)
- print '%10s: %s' % ('bzr', osutils.realpath(sys.argv[0]))
- print '%10s: %s' % ('bzrlib', bzrlib.__path__[0])
+ show_version(show_config=False, show_copyright=False)
print
if testspecs_list is not None:
pattern = '|'.join(testspecs_list)
=== modified file 'bzrlib/version.py'
--- a/bzrlib/version.py 2007-07-02 05:24:07 +0000
+++ b/bzrlib/version.py 2007-07-12 10:12:50 +0000
@@ -30,7 +30,7 @@
from bzrlib.branch import Branch
-def show_version():
+def show_version(show_config=True, show_copyright=False):
print "Bazaar (bzr) %s" % bzrlib.__version__
# is bzrlib itself in a branch?
src_tree = _get_bzr_source_tree()
@@ -41,24 +41,26 @@
print " revision:", revno
print " revid:", src_revision_id
print " branch nick:", src_tree.branch.nick
- print "Using Python interpreter:", sys.executable
- print "Using Python standard library:", os.path.dirname(os.__file__)
- print "Using bzrlib:",
+ print " Python interpreter:", sys.executable, '.'.join(map(str, sys.version_info))
+ print " Python standard library:", os.path.dirname(os.__file__)
+ print " 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 "Using Bazaar configuration:", config.config_dir()
- print "Using Bazaar log file:", trace._bzr_log_filename
- print
- print bzrlib.__copyright__
- print "http://bazaar-vcs.org/"
- print
- print "bzr comes with ABSOLUTELY NO WARRANTY. bzr is free software, and"
- print "you may use, modify and redistribute it under the terms of the GNU"
- print "General Public License version 2 or later."
+ if show_config:
+ print
+ print " Bazaar configuration:", config.config_dir()
+ print " Bazaar log file:", trace._bzr_log_filename
+ if show_copyright:
+ print bzrlib.__copyright__
+ print "http://bazaar-vcs.org/"
+ print
+ print "bzr comes with ABSOLUTELY NO WARRANTY. bzr is free software, and"
+ print "you may use, modify and redistribute it under the terms of the GNU"
+ print "General Public License version 2 or later."
def _get_bzr_source_tree():
More information about the bazaar-commits
mailing list