Part of lp.code.interfaces.branchcollection View In Hierarchy
Known subclasses: lp.code.interfaces.branchcollection.IAllBranches
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. |
Returns | a tuple (individual_count, team_count) containing the number of individuals and teams that own 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.
Parameters | eager_load | If True trigger eager loading of all the related objects in the collection. |
sort_by | an item from the BranchListingSort enumeration, or
None to return an unordered result set. |
Parameters | statuses | If specified, only return merge proposals with these statuses. If not, return all merge proposals. |
for_branches | An 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_branch | If specified, only return merge proposals that target the specified branch. | |
prerequisite_branch | If specified, only return merge proposals that require the specified branch to be merged first. | |
eager_load | If True, preloads all the related information for merge proposals like PreviewDiffs and Branches. |
person
.
Return the proposals for branches owned by person
or where person
is reviewing or been asked to review.
That is, all merge proposals that 'reviewer' has voted on or has been invited to vote on.
Parameters | reviewer | An IPerson who is a reviewer. |
status | An iterable of queue_status of the proposals to return. If None is specified, all the proposals of all possible states are returned. |
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.
Parameters | user | The user who is making the request. Only bug tasks visible to this user are returned. |
revisions | The revisions we want details for. |
A source package is effectively a sourcepackagename in a distro series.
A junk branch is a branch that's not associated with a product nor with a sourcepackage.
Parameters | term | A string. |
Returns | A ResultSet of branches that matched. |