Code review comment for lp:~jml/launchpad/get-by-urls

Revision history for this message
Jonathan Lange (jml) wrote :

This branch exposes a convenience API method for getting Bazaar branches based on their URL.

Generally, when you are trying to get the Launchpad object for a Bazaar branch, you cannot be sure which of the many URLs associated with a branch is the correct rule to try. This means you generally want to try multiple URLs. However, this means lots of roundtrips, which means slow code.

The new method getByUrls allows you to query multiple URLs. It returns a list of branch objects in an order that matches the list of URLs. If the branch is not found, None is put in its place.

In an ideal world, it would return a dict mapping URLs to branches, but the API system doesn't support that right now.

« Back to merge proposal