/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/version.py

  • Committer: Jelmer Vernooij
  • Date: 2018-05-06 11:48:54 UTC
  • mto: This revision was merged to the branch mainline in revision 6960.
  • Revision ID: jelmer@jelmer.uk-20180506114854-h4qd9ojaqy8wxjsd
Move .mailmap to root.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
 
25
25
import breezy
26
26
from . import (
27
 
    bedding,
 
27
    config,
28
28
    controldir,
29
29
    errors,
30
30
    osutils,
31
31
    trace,
32
32
    )
33
 
from .sixish import text_type
34
33
 
35
34
 
36
35
def show_version(show_config=True, show_copyright=True, to_file=None):
41
40
    src_tree = _get_brz_source_tree()
42
41
    if src_tree:
43
42
        src_revision_id = src_tree.last_revision()
 
43
        revno = src_tree.branch.revision_id_to_revno(src_revision_id)
44
44
        to_file.write("  from brz checkout %s\n" % (src_tree.basedir,))
45
 
        try:
46
 
            revno = src_tree.branch.revision_id_to_revno(src_revision_id)
47
 
        except errors.GhostRevisionsHaveNoRevno:
48
 
            pass
49
 
        else:
50
 
            to_file.write("    revision: %s\n" % (revno,))
 
45
        to_file.write("    revision: %s\n" % (revno,))
51
46
        to_file.write("    revid: %s\n" % (src_revision_id,))
52
47
        to_file.write("    branch nick: %s\n" % (src_tree.branch.nick,))
53
48
 
57
52
    # but sys.executable point to brz.exe itself)
58
53
    # however, sys.frozen exists if running from brz.exe
59
54
    # see http://www.py2exe.org/index.cgi/Py2exeEnvironment
60
 
    if getattr(sys, 'frozen', None) is None:  # if not brz.exe
 
55
    if getattr(sys, 'frozen', None) is None: # if not brz.exe
61
56
        to_file.write(sys.executable + ' ')
62
57
    else:
63
58
        # pythonXY.dll
70
65
 
71
66
    to_file.write("  Python standard library:" + ' ')
72
67
    to_file.write(os.path.dirname(os.__file__) + '\n')
73
 
    platform_str = platform.platform(aliased=1)
74
 
    if not isinstance(platform_str, text_type):
75
 
        platform_str = platform_str.decode('utf-8')
76
 
    to_file.write("  Platform: %s\n" % platform_str)
 
68
    to_file.write("  Platform: %s\n"
 
69
                  % platform.platform(aliased=1).decode('utf-8'))
77
70
    to_file.write("  breezy: ")
78
71
    if len(breezy.__path__) > 1:
79
72
        # print repr, which is a good enough way of making it clear it's
82
75
    else:
83
76
        to_file.write(breezy.__path__[0] + '\n')
84
77
    if show_config:
85
 
        config_dir = osutils.normpath(
86
 
            bedding.config_dir())  # use native slashes
87
 
        if not isinstance(config_dir, text_type):
 
78
        config_dir = osutils.normpath(config.config_dir())  # use native slashes
 
79
        if not isinstance(config_dir, unicode):
88
80
            config_dir = config_dir.decode(osutils.get_user_encoding())
89
81
        to_file.write("  Breezy configuration: %s\n" % (config_dir,))
90
82
        to_file.write("  Breezy log file: ")
94
86
        to_file.write(breezy.__copyright__ + '\n')
95
87
        to_file.write("https://www.breezy-vcs.org/\n")
96
88
        to_file.write('\n')
97
 
        to_file.write(
98
 
            "brz comes with ABSOLUTELY NO WARRANTY.  brz is free software, and\n")
99
 
        to_file.write(
100
 
            "you may use, modify and redistribute it under the terms of the GNU\n")
 
89
        to_file.write("brz comes with ABSOLUTELY NO WARRANTY.  brz is free software, and\n")
 
90
        to_file.write("you may use, modify and redistribute it under the terms of the GNU\n")
101
91
        to_file.write("General Public License version 2 or later.\n")
102
92
    to_file.write('\n')
103
93