~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/version.py

  • Committer: Samuel Bronson
  • Date: 2012-08-30 20:36:18 UTC
  • mto: (6015.57.3 2.4)
  • mto: This revision was merged to the branch mainline in revision 6558.
  • Revision ID: naesten@gmail.com-20120830203618-y2dzw91nqpvpgxvx
Update INSTALL for switch to Python 2.6 and up.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""Report on version of bzrlib"""
18
18
 
19
 
from __future__ import absolute_import
20
 
 
21
19
import os
22
 
import platform
23
20
import sys
24
21
 
25
22
import bzrlib
26
23
from bzrlib import (
 
24
    bzrdir,
27
25
    config,
28
 
    controldir,
29
26
    errors,
30
27
    osutils,
31
28
    trace,
33
30
 
34
31
 
35
32
def show_version(show_config=True, show_copyright=True, to_file=None):
 
33
    import platform
 
34
 
36
35
    if to_file is None:
37
36
        to_file = sys.stdout
38
37
    to_file.write("Bazaar (bzr) %s\n" % bzrlib.__version__)
65
64
 
66
65
    to_file.write("  Python standard library:" + ' ')
67
66
    to_file.write(os.path.dirname(os.__file__) + '\n')
68
 
    to_file.write("  Platform: %s\n"
69
 
                  % platform.platform(aliased=1).decode('utf-8'))
 
67
    to_file.write("  Platform: %s\n" % platform.platform(aliased=1))
70
68
    to_file.write("  bzrlib: ")
71
69
    if len(bzrlib.__path__) > 1:
72
70
        # print repr, which is a good enough way of making it clear it's
100
98
    If bzr is not being run from its working tree, returns None.
101
99
    """
102
100
    try:
103
 
        control = controldir.ControlDir.open_containing(__file__)[0]
 
101
        control = bzrdir.BzrDir.open_containing(__file__)[0]
104
102
        return control.open_workingtree(recommend_upgrade=False)
105
103
    except (errors.NotBranchError, errors.UnknownFormatError,
106
104
            errors.NoWorkingTree):