l.c.i.w.IBranchSet(Interface) : interface documentation

Part of lp.code.interfaces.webservice View In Hierarchy

Interface representing the set of branches.
Method getRecentlyChangedBranches Return a result set of branches that have been recently updated.
Method getRecentlyImportedBranches Return a result set of branches that have been recently imported.
Method getRecentlyRegisteredBranches Return a result set of branches that have been recently registered.
Method getByUniqueName Find a branch by its ~owner/product/name unique name.
Method getByUrl Find a branch by URL.
Method getByUrls Finds branches by URL.
Method getByPath Find a branch by its path.
Method getBranches Return a collection of branches.
Method getBranchVisibilityInfo Return the named branches visible to both user and person.
Method getMergeProposals Return the merge proposals that resulted in this revision.
def getRecentlyChangedBranches(branch_count=None, lifecycle_statuses=DEFAULT_BRANCH_STATUS_IN_LISTING, visible_by_user=None):
Return a result set of branches that have been recently updated.

Only HOSTED and MIRRORED branches are returned in the result set.

If branch_count is specified, the result set will contain at most branch_count items.

If lifecycle_statuses evaluates to False then branches of any lifecycle_status are returned, otherwise only branches with a lifecycle_status of one of the lifecycle_statuses are returned.

Parametersvisible_by_userIf a person is not supplied, only public branches are returned. If a person is supplied both public branches, and the private branches that the person is entitled to see are returned. Private branches are only visible to the owner and subscribers of the branch, and to LP admins. (type: IPerson or None)
def getRecentlyImportedBranches(branch_count=None, lifecycle_statuses=DEFAULT_BRANCH_STATUS_IN_LISTING, visible_by_user=None):
Return a result set of branches that have been recently imported.

The result set only contains IMPORTED branches.

If branch_count is specified, the result set will contain at most branch_count items.

If lifecycle_statuses evaluates to False then branches of any lifecycle_status are returned, otherwise only branches with a lifecycle_status of one of the lifecycle_statuses are returned.

Parametersvisible_by_userIf a person is not supplied, only public branches are returned. If a person is supplied both public branches, and the private branches that the person is entitled to see are returned. Private branches are only visible to the owner and subscribers of the branch, and to LP admins. (type: IPerson or None)
def getRecentlyRegisteredBranches(branch_count=None, lifecycle_statuses=DEFAULT_BRANCH_STATUS_IN_LISTING, visible_by_user=None):
Return a result set of branches that have been recently registered.

If branch_count is specified, the result set will contain at most branch_count items.

If lifecycle_statuses evaluates to False then branches of any lifecycle_status are returned, otherwise only branches with a lifecycle_status of one of the lifecycle_statuses are returned.

Parametersvisible_by_userIf a person is not supplied, only public branches are returned. If a person is supplied both public branches, and the private branches that the person is entitled to see are returned. Private branches are only visible to the owner and subscribers of the branch, and to LP admins. (type: IPerson or None)
@operation_parameters(TextLine(_('Branch unique name'), True))
@operation_returns_entry(IBranch)
@export_read_operation()
@operation_for_version('beta')
def getByUniqueName(unique_name):
Find a branch by its ~owner/product/name unique name.

Return None if no match was found.

@operation_parameters(TextLine(_('Branch URL'), True))
@operation_returns_entry(IBranch)
@export_read_operation()
@operation_for_version('beta')
def getByUrl(url):
Find a branch by URL.

Either from the external specified in Branch.url, from the URL on http://bazaar.launchpad.net/ or the lp: URL.

This is a frontend shim to IBranchLookup.getByUrl to allow it to be exported over the API. If you want to call this from within the Launchpad app, use the IBranchLookup version instead.

Return None if no match was found.

@operation_parameters(List(u'A list of URLs of branches', u'These can be URLs external to Launchpad, lp: URLs, or http://bazaar.launchpad.net/ URLs, or any mix of all these different kinds.', TextLine(), True))
@export_read_operation()
@operation_for_version('beta')
def getByUrls(urls):
Finds branches by URL.

Either from the external specified in Branch.url, from the URL on http://bazaar.launchpad.net/, or from the lp: URL.

This is a frontend shim to IBranchLookup.getByUrls to allow it to be exported over the API. If you want to call this from within the Launchpad app, use the IBranchLookup version instead.

ParametersurlsAn iterable of URLs expressed as strings.
ReturnsA dictionary mapping URLs to branches. If the URL has no associated branch, the URL will map to None.
@operation_parameters(TextLine(_('Branch path'), True))
@operation_returns_entry(IBranch)
@export_read_operation()
@operation_for_version('devel')
def getByPath(path):
Find a branch by its path.

The path is the same as its lp: URL, but without the leading lp:, so it may be in any of these forms:

Unique names:
    ~OWNER/PROJECT/NAME
    ~OWNER/DISTRO/SERIES/SOURCE/NAME
    ~OWNER/+junk/NAME
Aliases linked to other objects:
    PROJECT
    PROJECT/SERIES
    DISTRO/SOURCE
    DISTRO/SUITE/SOURCE

Return None if no match was found.

@collection_default_content()
def getBranches(limit=50, eager_load=True):
Return a collection of branches.
Parameterseager_loadIf True (the default because this is used in the web service and it needs the related objects to create links) eager load related objects (products, code imports etc).
@call_with(REQUEST_USER)
@operation_parameters(Reference(_('The person whose branch visibility is being checked.'), IPerson), List(Text(), _('List of branch unique names'), True))
@export_read_operation()
@operation_for_version('devel')
def getBranchVisibilityInfo(user, person, branch_names):
Return the named branches visible to both user and person.

Anonymous requesters don't get any information.

Return a dict with the following values: person_name: the displayname of the person. visible_branches: a list of the unique names of the branches which the requester and specified person can both see.

This API call is provided for use by the client Javascript. It is not designed to efficiently scale to handle requests for large numbers of branches.

ParametersuserThe user requesting the information. If the user is None then we return an empty dict.
personThe person whose branch visibility we wish to check.
branch_namesThe unique names of the branches to check.
@operation_returns_collection_of(Interface)
@call_with(REQUEST_USER)
@operation_parameters(TextLine())
@export_read_operation()
@operation_for_version('devel')
def getMergeProposals(merged_revision, visible_by_user=None):
Return the merge proposals that resulted in this revision.
Parametersmerged_revisionThe revision_id of the revision that resulted from this merge proposal.
visible_by_userThe user to whom the proposals must be visible. If None, only public proposals will be returned.
API Documentation for Launchpad, generated by pydoctor at 2019-09-18 00:00:08.