l.c.i.b.IBranchCollection(Interface) : interface documentation

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

Known subclasses: lp.code.interfaces.branchcollection.IAllBranches

A collection of branches.

An IBranchCollection is an immutable collection of branches. It has two kinds of methods: filter methods and query methods.

Query methods get information about the contents of collection. See IBranchCollection.count and IBranchCollection.getBranches.

Filter methods return new IBranchCollection instances that have some sort of restriction. Examples include ownedBy, visibleByUser and inProduct.

Implementations of this interface are not 'content classes'. That is, they do not correspond to a particular row in the database.

This interface is intended for use within Launchpad, not to be exported as a public API.

Method count The number of branches in this collection.
Method is_empty Is this collection empty?
Method ownerCounts Return the number of different branch owners.
Method getBranches Return a result set of all branches in this collection.
Method getBranchIds Return a result set of all branch ids in this collection.
Method getMergeProposals Return a result set of merge proposals for the branches in this
Method getMergeProposalsForPerson Proposals for person.
Method getMergeProposalsForReviewer Return a result set of merge proposals for the given reviewer.
Method getExtendedRevisionDetails Return information about the specified revisions on a branch.
Method getTeamsWithBranches Return the teams that person is a member of that have branches.
Method inProduct Restrict the collection to branches in 'product'.
Method inProjectGroup Restrict the collection to branches in 'projectgroup'.
Method inSourcePackage Restrict the collection to branches in 'package'.
Method inDistribution Restrict the collection to branches in 'distribution'.
Method inDistroSeries Restrict the collection to branches in 'distro_series'.
Method inDistributionSourcePackage Restrict to branches in a 'package' for a 'distribution'.
Method linkedToBugs Restrict to branches linked to bugs.
Method officialBranches Restrict to branches that are official for some source package.
Method isJunk Restrict the collection to junk branches.
Method isPrivate Restrict the collection to private branches.
Method isExclusive Restrict the collection to branches owned by exclusive people.
Method isSeries Restrict the collection to branches those linked to series.
Method ownedBy Restrict the collection to branches owned by 'person'.
Method ownedByTeamMember Restrict the collection to branches owned by 'person' or a team
Method registeredBy Restrict the collection to branches registered by 'person'.
Method search Search the collection for branches matching 'term'.
Method scanned Restrict the collection to branches that have been scanned.
Method subscribedBy Restrict the collection to branches subscribed to by 'person'.
Method visibleByUser Restrict the collection to branches that person is allowed to see.
Method withBranchType Restrict the collection to branches with the given branch types.
Method withLifecycleStatus Restrict the collection to branches with the given statuses.
Method modifiedSince Restrict the collection to branches modified since epoch.
Method scannedSince Restrict the collection to branches scanned since epoch.
Method targetedBy Restrict the collection to branches targeted by person.
Method withIds Restrict the collection to branches with the specified ids.
def count():
The number of branches in this collection.
def is_empty():
Is this collection empty?
def ownerCounts():
Return the number of different branch owners.
Returnsa tuple (individual_count, team_count) containing the number of individuals and teams that own branches in this collection.
def getBranches(eager_load=False, sort_by=None):
Return a result set of all branches in this collection.

The returned result set will also join across the specified tables as defined by the arguments to this function. These extra tables are joined specifically to allow the caller to sort on values not in the Branch table itself.

Parameterseager_loadIf True trigger eager loading of all the related objects in the collection.
sort_byan item from the BranchListingSort enumeration, or None to return an unordered result set.
def getBranchIds():
Return a result set of all branch ids in this collection.
def getMergeProposals(statuses=None, for_branches=None, target_branch=None, prerequisite_branch=None, eager_load=False):
Return a result set of merge proposals for the branches in this collection.
ParametersstatusesIf specified, only return merge proposals with these statuses. If not, return all merge proposals.
for_branchesAn iterable of branches what will restrict the resulting set of merge proposals to be only those where the source branch is one of the branches specified.
target_branchIf specified, only return merge proposals that target the specified branch.
prerequisite_branchIf specified, only return merge proposals that require the specified branch to be merged first.
eager_loadIf True, preloads all the related information for merge proposals like PreviewDiffs and Branches.
def getMergeProposalsForPerson(person, status=None):
Proposals for person.

Return the proposals for branches owned by person or where person is reviewing or been asked to review.

def getMergeProposalsForReviewer(reviewer, status=None):
Return a result set of merge proposals for the given reviewer.

That is, all merge proposals that 'reviewer' has voted on or has been invited to vote on.

ParametersreviewerAn IPerson who is a reviewer.
statusAn iterable of queue_status of the proposals to return. If None is specified, all the proposals of all possible states are returned.
def getExtendedRevisionDetails(user, revisions):
Return information about the specified revisions on a branch.

For each revision, see if the revision resulted from merging in a merge proposal, and if so package up the merge proposal and any linked bug tasks on the merge proposal's source branch.

ParametersuserThe user who is making the request. Only bug tasks visible to this user are returned.
revisionsThe revisions we want details for.
def getTeamsWithBranches(person):
Return the teams that person is a member of that have branches.
def inProduct(product):
Restrict the collection to branches in 'product'.
def inProjectGroup(projectgroup):
Restrict the collection to branches in 'projectgroup'.
def inSourcePackage(package):
Restrict the collection to branches in 'package'.

A source package is effectively a sourcepackagename in a distro series.

def inDistribution(distribution):
Restrict the collection to branches in 'distribution'.
def inDistroSeries(distro_series):
Restrict the collection to branches in 'distro_series'.
def inDistributionSourcePackage(distro_source_package):
Restrict to branches in a 'package' for a 'distribution'.
def linkedToBugs(bugs):
Restrict to branches linked to bugs.
def officialBranches(pocket=None):
Restrict to branches that are official for some source package.
def isJunk():
Restrict the collection to junk branches.

A junk branch is a branch that's not associated with a product nor with a sourcepackage.

def isPrivate():
Restrict the collection to private branches.
def isExclusive():
Restrict the collection to branches owned by exclusive people.
def isSeries():
Restrict the collection to branches those linked to series.
def ownedBy(person):
Restrict the collection to branches owned by 'person'.
def ownedByTeamMember(person):
Restrict the collection to branches owned by 'person' or a team of which person is a member.
def registeredBy(person):
Restrict the collection to branches registered by 'person'.
def search(term):
Search the collection for branches matching 'term'.
ParameterstermA string.
ReturnsA ResultSet of branches that matched.
def scanned():
Restrict the collection to branches that have been scanned.
def subscribedBy(person):
Restrict the collection to branches subscribed to by 'person'.
def visibleByUser(person):
Restrict the collection to branches that person is allowed to see.
def withBranchType(*branch_types):
Restrict the collection to branches with the given branch types.
def withLifecycleStatus(*statuses):
Restrict the collection to branches with the given statuses.
def modifiedSince(epoch):
Restrict the collection to branches modified since epoch.
def scannedSince(epoch):
Restrict the collection to branches scanned since epoch.
def targetedBy(person, since=None):
Restrict the collection to branches targeted by person.

A branch is targeted by a person if that person has registered a merge proposal with the branch as the target.

ParameterssinceIf supplied, ignore merge proposals before this date.
def withIds(*branch_ids):
Restrict the collection to branches with the specified ids.
API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.