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
=== modified file 'lib/devscripts/ec2test/entrypoint.py'
--- lib/devscripts/ec2test/entrypoint.py 2009-12-23 02:26:54 +0000
+++ lib/devscripts/ec2test/entrypoint.py 2010-08-26 04:41:05 +0000
@@ -3,6 +3,8 @@
33
4"""The entry point for the 'ec2' utility."""4"""The entry point for the 'ec2' utility."""
55
6from __future__ import with_statement
7
6__metaclass__ = type8__metaclass__ = type
7__all__ = [9__all__ = [
8 'main',10 'main',
@@ -12,8 +14,8 @@
12import rlcompleter14import rlcompleter
13import sys15import sys
1416
17import bzrlib
15from bzrlib.errors import BzrCommandError18from bzrlib.errors import BzrCommandError
16from bzrlib import ui
1719
18from devscripts.ec2test import builtins20from devscripts.ec2test import builtins
19from devscripts.ec2test.controller import (21from devscripts.ec2test.controller import (
@@ -33,19 +35,15 @@
3335
34 We run the specified command, or give help if none was specified.36 We run the specified command, or give help if none was specified.
35 """37 """
36 # XXX MichaelHudson, 2009-12-23, bug=499637: run_bzr fails unless you set38 with bzrlib.initialize():
37 # a ui_factory.39 controller = EC2CommandController()
38 ui.ui_factory = ui.make_ui_for_terminal(40 controller.install_bzrlib_hooks()
39 sys.stdin, sys.stdout, sys.stderr)41 controller.load_module(builtins)
4042
41 controller = EC2CommandController()43 args = sys.argv[1:]
42 controller.install_bzrlib_hooks()44 if not args:
43 controller.load_module(builtins)45 args = ['help']
4446 try:
45 args = sys.argv[1:]47 controller.run(args)
46 if not args:48 except BzrCommandError, e:
47 args = ['help']49 sys.exit('ec2: ERROR: ' + str(e))
48 try:
49 controller.run(args)
50 except BzrCommandError, e:
51 sys.exit('ec2: ERROR: ' + str(e))