/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: Jelmer Vernooij
  • Date: 2011-04-21 01:19:32 UTC
  • mto: This revision was merged to the branch mainline in revision 5821.
  • Revision ID: jelmer@samba.org-20110421011932-bstjprox25mfltzu
Fix some tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
import warnings
24
24
 
25
25
# update this on each release
26
 
_script_version = (2, 2, 0)
 
26
_script_version = (2, 4, 0)
27
27
 
28
28
try:
29
29
    version_info = sys.version_info
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:
135
133
 
136
134
 
137
135
if __name__ == '__main__':
138
 
    bzrlib.initialize()
139
 
    exit_val = bzrlib.commands.main()
140
 
 
141
 
    if profiling:
142
 
        profile_imports.log_stack_info(sys.stderr)
 
136
    library_state = bzrlib.initialize()
 
137
    library_state.__enter__()
 
138
    try:
 
139
        exit_val = bzrlib.commands.main()
 
140
        if profiling:
 
141
            profile_imports.log_stack_info(sys.stderr)
 
142
    finally:
 
143
        library_state.__exit__(None, None, None)
143
144
 
144
145
    # By this point we really have completed everything we want to do, and
145
146
    # there's no point doing any additional cleanup.  Abruptly exiting here