Part of lp.code.interfaces.branchlookup View In Hierarchy
Method | get | Return the branch with the given id. |
Method | getByHostingPath | Get information about a given codehosting path. |
Method | getByUniqueName | Find a branch by its ~owner/product/name unique name. |
Method | uriToHostingPath | Return the path for the URI, if the URI is on codehosting. |
Method | getByUrl | Find a branch by URL. |
Method | performLookup | Find a branch and trailing path according to params |
Method | getByUrls | Find branches by URL. |
Method | getByLPPath | Find the branch associated with an lp: path. |
Method | getByPath | Find the branch associated with a path. |
Return the default value if there is no such branch.
If the path includes a branch, it is returned. Otherwise, None. The portion of the path following the branch's portion is returned as 'trailing'.
Returns | A tuple of (branch, trailing). |
Return None if no match was found.
This does not ensure that the path is valid. It recognizes the codehosting URIs of remote branches and mirrors, but not their remote URIs.
Parameters | uri | An instance of lazr.uri.URI |
Returns | The path if possible, None if the URI is not a valid codehosting URI. |
Either from the external specified in Branch.url, from the URL on http://bazaar.launchpad.net/ or the lp: URL.
Return None if no match was found.
Parameters | urls | A list of URLs expressed as strings. |
Returns | A dictionary mapping those URLs to IBranch objects. If
there is no branch for a URL, the URL is mapped to None instead. |
Find the branch associated with an lp: path. Recognized formats: "~owner/product/name" (same as unique name) "distro/series/sourcepackage" (official branch for release pocket of the version of a sourcepackage in a distro series) "distro/series-pocket/sourcepackage" (official branch for the given pocket of the version of a sourcepackage in a distro series) "product/series" (branch associated with a product series) "product" (development focus of product) :raises InvalidNamespace: If the path looks like a unique branch name but doesn't have enough segments to be a unique name. :raises InvalidProductName: If the given product in a product or product series shortcut is an invalid name for a product. :raises NoSuchBranch: If we can't find a branch that matches the branch component of the path. :raises NoSuchPerson: If we can't find a person who matches the person component of the path. :raises NoSuchProduct: If we can't find a product that matches the product component of the path. :raises NoSuchDistroSeries: If the distro series component doesn't match an existing series. :raises NoSuchSourcePackageName: If the source packagae referred to does not exist. :raises NoLinkedBranch: If the path refers to an existing thing that's not a branch and has no default branch associated with it. For example, a product without a development focus branch. :raises CannotHaveLinkedBranch: If the path refers to an existing thing that cannot have a linked branch associated with it. For example, a distribution. :return: a tuple of (`IBranch`, extra_path). 'extra_path' is used to make things like 'bzr cat lp:~foo/bar/baz/README' work. Trailing paths are not handled for shortcut paths.
As with getByLPPath
, but returns None instead of raising any of
the documented exceptions, and returns only the IBranch
on success
and not any extra path.