Rev 2615: Update tests for new version display in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Fri Jul 13 06:09:46 BST 2007


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 2615
revision-id: pqm at pqm.ubuntu.com-20070713050943-v0ag8yiwniny9tp0
parent: pqm at pqm.ubuntu.com-20070713041212-ar46c24wgu0jhtm5
parent: mbp at sourcefrog.net-20070713031631-4gjpqe2qabwvtmvm
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Fri 2007-07-13 06:09:43 +0100
message:
  Update tests for new version display
modified:
  bzrlib/builtins.py             builtins.py-20050830033751-fc01482b9ca23183
  bzrlib/tests/blackbox/test_version.py test_version.py-20070312060045-ol7th9z035r3im3d-1
  bzrlib/version.py              version.py-20060816024207-ves6ult9a11taj9t-1
    ------------------------------------------------------------
    revno: 2606.1.3
    merged: mbp at sourcefrog.net-20070713031631-4gjpqe2qabwvtmvm
    parent: mbp at sourcefrog.net-20070713013719-x6j1ha53ymowniri
    committer: Martin Pool <mbp at sourcefrog.net>
    branch nick: test-cleanup
    timestamp: Fri 2007-07-13 13:16:31 +1000
    message:
      Update tests for new version display
    ------------------------------------------------------------
    revno: 2606.1.2
    merged: mbp at sourcefrog.net-20070713013719-x6j1ha53ymowniri
    parent: mbp at sourcefrog.net-20070712101250-yvle0aj6ro1ww707
    committer: Martin Pool <mbp at sourcefrog.net>
    branch nick: test-cleanup
    timestamp: Fri 2007-07-13 11:37:19 +1000
    message:
      Restore display of copyright in bzr version, accidentally removed
    ------------------------------------------------------------
    revno: 2606.1.1
    merged: 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 file 'bzrlib/builtins.py'
--- a/bzrlib/builtins.py	2007-07-12 13:35:54 +0000
+++ b/bzrlib/builtins.py	2007-07-13 05:09:43 +0000
@@ -2475,11 +2475,12 @@
         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])
+        if not list_only:
+            show_version(show_config=False, show_copyright=False)
         print
         if testspecs_list is not None:
             pattern = '|'.join(testspecs_list)

=== modified file 'bzrlib/tests/blackbox/test_version.py'
--- a/bzrlib/tests/blackbox/test_version.py	2007-07-02 05:24:07 +0000
+++ b/bzrlib/tests/blackbox/test_version.py	2007-07-13 03:16:31 +0000
@@ -26,8 +26,8 @@
         out = self.run_bzr("version")[0]
         self.assertTrue(len(out) > 0)
         self.assertEquals(1, out.count(bzrlib.__version__))
-        self.assertEquals(1, out.count("Using Python interpreter:"))
-        self.assertEquals(1, out.count("Using Python standard library:"))
-        self.assertEquals(1, out.count("Using bzrlib:"))
-        self.assertEquals(1, out.count("Using Bazaar configuration:"))
-        self.assertContainsRe(out, r'(?m)^Using Bazaar log file:.*bzr\.log')
+        self.assertContainsRe(out, r"(?m)^  Python interpreter:")
+        self.assertContainsRe(out, r"(?m)^  Python standard library:")
+        self.assertContainsRe(out, r"(?m)^  bzrlib:")
+        self.assertContainsRe(out, r"(?m)^  Bazaar configuration:")
+        self.assertContainsRe(out, r'(?m)^  Bazaar log file:.*bzr\.log')

=== modified file 'bzrlib/version.py'
--- a/bzrlib/version.py	2007-07-02 05:24:07 +0000
+++ b/bzrlib/version.py	2007-07-13 01:37:19 +0000
@@ -30,7 +30,7 @@
 from bzrlib.branch import Branch
 
 
-def show_version():
+def show_version(show_config=True, show_copyright=True):
     print "Bazaar (bzr) %s" % bzrlib.__version__
     # is bzrlib itself in a branch?
     src_tree = _get_bzr_source_tree()
@@ -41,24 +41,27 @@
         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 "  Bazaar configuration:", config.config_dir()
+        print "  Bazaar log file:", trace._bzr_log_filename
+    if show_copyright:
+        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."
+    print
 
 
 def _get_bzr_source_tree():




More information about the bazaar-commits mailing list