/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 bzr

  • Committer: Martin Pool
  • Author(s): Dennis Benzinger
  • Date: 2011-08-15 07:29:01 UTC
  • mto: (6015.9.13 2.4)
  • mto: This revision was merged to the branch mainline in revision 6090.
  • Revision ID: mbp@canonical.com-20110815072901-ujook48jblv01wh3
Fixed description of BZR_PROGRESS_BAR in "bzr help env-variables".

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#! /usr/bin/env python
2
2
 
3
 
# Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Canonical Ltd
 
3
# Copyright (C) 2005-2011 Canonical Ltd
4
4
#
5
5
# This program is free software; you can redistribute it and/or modify
6
6
# it under the terms of the GNU General Public License as published by
23
23
import warnings
24
24
 
25
25
# update this on each release
26
 
_script_version = (2, 2, 0)
 
26
_script_version = (2, 4, 1)
27
27
 
28
28
try:
29
29
    version_info = sys.version_info
30
30
except AttributeError:
31
 
    version_info = 1, 5 # 1.5 or older
 
31
    version_info = 1, 5  # 1.5 or older
32
32
 
33
33
REINVOKE = "__BZR_REINVOKE"
34
 
NEED_VERS = (2, 4)
35
 
KNOWN_PYTHONS = ('python2.4', 'python2.5', 'python2.6')
 
34
NEED_VERS = (2, 6)
 
35
KNOWN_PYTHONS = ('python2.6', 'python2.7')
36
36
 
37
37
if version_info < NEED_VERS:
38
38
    if not os.environ.has_key(REINVOKE):
52
52
 
53
53
profiling = False
54
54
if '--profile-imports' in sys.argv:
55
 
    sys.argv.remove('--profile-imports')
56
55
    import profile_imports
57
56
    profile_imports.install()
58
57
    profiling = True
76
75
else:
77
76
    import locale
78
77
 
 
78
if os.name == "posix":
 
79
    try:
 
80
        locale.setlocale(locale.LC_ALL, '')
 
81
    except locale.Error, e:
 
82
        sys.stderr.write('bzr: warning: %s\n'
 
83
            '  bzr could not set the application locale.\n'
 
84
            '  Although this should be no problem for bzr itself, it might\n'
 
85
            '  cause problems with some plugins. To investigate the issue,\n'
 
86
            '  look at the output of the locale(1p) tool.\n' % e)
 
87
 
79
88
 
80
89
# The python2.6 release includes some libraries that have deprecation warnings
81
90
# against the interpreter - see https://bugs.launchpad.net/bzr/+bug/387139
87
96
    )
88
97
 
89
98
 
90
 
try:
91
 
    locale.setlocale(locale.LC_ALL, '')
92
 
except locale.Error, e:
93
 
    sys.stderr.write('bzr: warning: %s\n'
94
 
                     '  bzr could not set the application locale.\n'
95
 
                     '  Although this should be no problem for bzr itself,\n'
96
 
                     '  it might cause problems with some plugins.\n'
97
 
                     '  To investigate the issue, look at the output\n'
98
 
                     '  of the locale(1p) tool available on POSIX systems.\n'
99
 
                     % e)
100
 
 
101
99
# instruct bzrlib/__init__.py to install lazy_regex
102
100
sys._bzr_lazy_regex = True
103
101
try:
110
108
    raise
111
109
 
112
110
if bzrlib.version_info[:3] != _script_version:
113
 
    sys.stderr.write("bzr: WARNING: bzrlib version doesn't match the bzr program.\n"
114
 
            "This may indicate an installation problem.\n"
115
 
            "bzrlib from %s is version %r\n"
116
 
            % (bzrlib.__path__, bzrlib.version_info))
 
111
    sys.stderr.write(
 
112
        "bzr: WARNING: bzrlib version doesn't match the bzr program.\n"
 
113
        "This may indicate an installation problem.\n"
 
114
        "bzrlib is version %s from %s\n"
 
115
        "bzr is version %s from %s\n" % (
 
116
        bzrlib._format_version_tuple(bzrlib.version_info),
 
117
        bzrlib.__path__[0],
 
118
        bzrlib._format_version_tuple(_script_version),
 
119
        __file__))
 
120
 
117
121
 
118
122
import bzrlib.inspect_for_copy
119
123
bzrlib.inspect_for_copy.import_copy_with_hacked_inspect()
135
139
 
136
140
 
137
141
if __name__ == '__main__':
138
 
    bzrlib.initialize()
139
 
    exit_val = bzrlib.commands.main()
140
 
 
141
 
    if profiling:
142
 
        profile_imports.log_stack_info(sys.stderr)
 
142
    library_state = bzrlib.initialize()
 
143
    library_state.__enter__()
 
144
    try:
 
145
        exit_val = bzrlib.commands.main()
 
146
        if profiling:
 
147
            profile_imports.log_stack_info(sys.stderr)
 
148
    finally:
 
149
        library_state.__exit__(None, None, None)
143
150
 
144
151
    # By this point we really have completed everything we want to do, and
145
152
    # there's no point doing any additional cleanup.  Abruptly exiting here