Merge lp:~mwhudson/launchpad/initialize-bzrlib-in-ec2-bug-624434 into lp:launchpad

Proposed by Michael Hudson-Doyle
Status: Merged
Approved by: Tim Penhey
Approved revision: no longer in the source branch.
Merged at revision: 11448
Proposed branch: lp:~mwhudson/launchpad/initialize-bzrlib-in-ec2-bug-624434
Merge into: lp:launchpad
Diff against target: 54 lines (+15/-17)
1 file modified
lib/devscripts/ec2test/entrypoint.py (+15/-17)
To merge this branch: bzr merge lp:~mwhudson/launchpad/initialize-bzrlib-in-ec2-bug-624434
Reviewer Review Type Date Requested Status
Tim Penhey (community) Approve
Review via email: mp+33730@code.launchpad.net

Commit message

bin/ec2 now calls bzrlib.initialize() before using bzrlib

Description of the change

Hi, as per the bug report, bin/ec2 need to call bzrlib.initialize() now.

To post a comment you must log in.
Revision history for this message
Tim Penhey (thumper) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/devscripts/ec2test/entrypoint.py'
2--- lib/devscripts/ec2test/entrypoint.py 2009-12-23 02:26:54 +0000
3+++ lib/devscripts/ec2test/entrypoint.py 2010-08-26 04:41:05 +0000
4@@ -3,6 +3,8 @@
5
6 """The entry point for the 'ec2' utility."""
7
8+from __future__ import with_statement
9+
10 __metaclass__ = type
11 __all__ = [
12 'main',
13@@ -12,8 +14,8 @@
14 import rlcompleter
15 import sys
16
17+import bzrlib
18 from bzrlib.errors import BzrCommandError
19-from bzrlib import ui
20
21 from devscripts.ec2test import builtins
22 from devscripts.ec2test.controller import (
23@@ -33,19 +35,15 @@
24
25 We run the specified command, or give help if none was specified.
26 """
27- # XXX MichaelHudson, 2009-12-23, bug=499637: run_bzr fails unless you set
28- # a ui_factory.
29- ui.ui_factory = ui.make_ui_for_terminal(
30- sys.stdin, sys.stdout, sys.stderr)
31-
32- controller = EC2CommandController()
33- controller.install_bzrlib_hooks()
34- controller.load_module(builtins)
35-
36- args = sys.argv[1:]
37- if not args:
38- args = ['help']
39- try:
40- controller.run(args)
41- except BzrCommandError, e:
42- sys.exit('ec2: ERROR: ' + str(e))
43+ with bzrlib.initialize():
44+ controller = EC2CommandController()
45+ controller.install_bzrlib_hooks()
46+ controller.load_module(builtins)
47+
48+ args = sys.argv[1:]
49+ if not args:
50+ args = ['help']
51+ try:
52+ controller.run(args)
53+ except BzrCommandError, e:
54+ sys.exit('ec2: ERROR: ' + str(e))