At http://bzr.arbash-meinel.com/branches/bzr/jam-integration
------------------------------------------------------------ revno: 4042 revision-id: [email protected] parent: [email protected] committer: John Arbash Meinel <[email protected]> branch nick: jam-integration timestamp: Mon 2009-03-02 09:11:37 -0600 message: Turn a bunch of imports into lazy imports. Fix a failing test due to a new error message.
=== modified file 'bzrlib/plugins/launchpad/__init__.py' --- a/bzrlib/plugins/launchpad/__init__.py 2009-02-24 04:03:53 +0000 +++ b/bzrlib/plugins/launchpad/__init__.py 2009-03-02 15:11:37 +0000 @@ -21,9 +21,16 @@ # see http://bazaar-vcs.org/Specs/BranchRegistrationTool +from bzrlib.lazy_import import lazy_import +lazy_import(globals(), """ import webbrowser -from bzrlib.branch import Branch +from bzrlib import ( + branch as _mod_branch, + trace, + ) +""") + from bzrlib.commands import Command, Option, register_command from bzrlib.directory_service import directories from bzrlib.errors import ( @@ -37,7 +44,6 @@ LaunchpadService, NotLaunchpadBranch, ) -from bzrlib.trace import note class cmd_register_branch(Command): @@ -103,7 +109,7 @@ DryRunLaunchpadService) if public_url is None: try: - b = Branch.open_containing('.')[0] + b = _mod_branch.Branch.open_containing('.')[0] except NotBranchError: raise BzrCommandError('register-branch requires a public ' 'branch url - see bzr help register-branch.') @@ -154,7 +160,7 @@ """Yield possible external locations for the branch at 'location'.""" yield location try: - branch = Branch.open(location) + branch = _mod_branch.Branch.open(location) except NotBranchError: return branch_url = branch.get_public_branch() @@ -176,7 +182,7 @@ if location is None: location = u'.' web_url = self._get_web_url(LaunchpadService(), location) - note('Opening %s in web browser' % web_url) + trace.note('Opening %s in web browser' % web_url) if not dry_run: webbrowser.open(web_url) === modified file 'bzrlib/plugins/launchpad/test_lp_service.py' --- a/bzrlib/plugins/launchpad/test_lp_service.py 2009-01-25 17:43:47 +0000 +++ b/bzrlib/plugins/launchpad/test_lp_service.py 2009-03-02 15:11:37 +0000 @@ -126,7 +126,7 @@ NotLaunchpadBranch, service.get_web_url_from_branch_url, 'bzr+ssh://example.com/~foo/bar/baz') self.assertEqual( - 'bzr+ssh://example.com/~foo/bar/baz is not hosted on Launchpad.', + 'bzr+ssh://example.com/~foo/bar/baz is not registered on Launchpad.', str(error)) def test_dodgy_launchpad_url(self):
-- bazaar-commits mailing list [email protected] https://lists.ubuntu.com/mailman/listinfo/bazaar-commits
