[MERGE] improved lp:/// URL support for the Launchpad plugin

James Henstridge james at jamesh.id.au
Mon Nov 5 19:45:29 GMT 2007


Attached is a bundle that updates the lp:/// URL implementation in the
Launchpad plugin to make use of a new RPC call included in the recent
Launchpad rollout.  I added some details of the new RPC to the wiki
at:
    http://bazaar-vcs.org/Specs/LaunchpadRpc

The current lp:/// implementation acts roughly like follows:
 1. rewrite the lp:$PATH URL to http://code.launchpad.net/$PATH in
get_transport()
 2. when opening the branch, an HTTP redirect is received to the
equivalent https URL.
 3. when opening the bzrdir for that path we find a BranchReference
(which is three https requests).
 4. Bazaar opens the branch from its real location on
http://bazaar.launchpad.net

With the new Launchpad RPC call, the lookups are replaced by a single
XMLRPC https request.  As well as being faster, this lets us provide
nicer error messages.  For example:

$ ./bzr branch lp:postgresql
bzr: ERROR: Invalid url supplied to transport: "lp:postgresql": Series
current on postgresql has no branch associated with it

Furthermore, if the user has given their Launchpad user ID to Bazaar
(with the "bzr launchpad-login" command), we'll resolve to a
bzr+ssh://bazaar.launchpad.net URL, which makes it possible to push to
an lp: URL (provided that the branch already exists).

The implementation has been changed from doing the redirection at
get_transport() time to issuing a simple transport that issues a
RedirectRequested() exception at the appropriate point.  The reason
for this change was to avoid performing network operations on
get_transport().

James.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bzr-lp-urls.patch
Type: text/x-diff
Size: 43079 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20071105/1c90ac4a/attachment-0001.bin 


More information about the bazaar mailing list