~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzr

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-07-19 14:26:11 UTC
  • mfrom: (5346.4.6 cleanup)
  • Revision ID: pqm@pqm.ubuntu.com-20100719142611-fbhst4ivcngc32d5
(mbp) tree_files and internal_tree files moved to WorkingTree (Martin Pool)

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, 3, 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
135
134
 
136
135
 
137
136
if __name__ == '__main__':
138
 
    bzrlib.initialize()
139
 
    exit_val = bzrlib.commands.main()
140
 
 
141
 
    if profiling:
142
 
        profile_imports.log_stack_info(sys.stderr)
 
137
    library_state = bzrlib.initialize()
 
138
    library_state.__enter__()
 
139
    try:
 
140
        exit_val = bzrlib.commands.main()
 
141
        if profiling:
 
142
            profile_imports.log_stack_info(sys.stderr)
 
143
    finally:
 
144
        library_state.__exit__(None, None, None)
143
145
 
144
146
    # By this point we really have completed everything we want to do, and
145
147
    # there's no point doing any additional cleanup.  Abruptly exiting here