Part of lp.code.interfaces.branch View In Hierarchy
Known subclasses: lp.code.interfaces.webservice.IBranch
Int | id | Undocumented |
Method | composePublicURL | Return a public URL for the branch using the given protocol. |
Choice | distroseries | The distribution series that this branch belongs to. Branches do not have to belong to a distribution series, they can also belong to a project or be junk branches. |
Choice | sourcepackagename | The source package that this is a branch of. Source package branches always belong to a distribution series. |
Attribute | distribution | The IDistribution that this branch belongs to. None if not a package branch. |
Attribute | namespace | The namespace of this branch, as an IBranchNamespace . |
Attribute | displayname | Display name (deprecated) |
Attribute | code_reviewer | The reviewer if set, otherwise the owner of the branch. |
Method | isPersonTrustedReviewer | Return true if the reviewer is a trusted reviewer. |
Text | last_mirrored_id | The head revision ID of the branch when last successfully mirrored. |
Attribute | mirror_failures | Number of failed mirror attempts since the last successful mirror. |
Datetime | next_mirror_time | Undocumented |
Attribute | stacked_on | Stacked-on branch |
Method | getLinkedBugTasks | Return a result set for the tasks that are relevant to this branch. |
Method | linkBug | Link a bug to this branch. |
Method | unlinkBug | Unlink a bug to this branch. |
Method | getSpecificationLinks | Fetch the ISpecificationBranch 's that the user can view. |
Method | linkSpecification | Link an ISpecification to a branch. |
Method | unlinkSpecification | Unlink an ISpecification to a branch. |
Attribute | revision_history | The sequence of revisions for the mainline of this branch. |
Attribute | pending_writes | Whether there is new Bazaar data for this branch. |
Attribute | pending_updates | Whether there is an update job of some kind (mirroring or scanning) pending for the Bazaar data in this branch. Note that pending_writes may be True and pending_updates False if a branch has been unscanned. |
Method | latest_revisions | A specific number of the latest revisions in that branch. |
Attribute | landing_targets | A collection of the merge proposals where this branch is the source branch. |
Attribute | landing_candidates | A collection of the merge proposals where this branch is the target branch. |
Method | getPrecachedLandingTargets | Return precached landing targets. |
Method | getPrecachedLandingCandidates | Return precached landing candidates. |
Method | isBranchMergeable | Is the other branch mergeable into this branch (or vice versa)? |
Method | addLandingTarget | Create a new BranchMergeProposal with this branch as the source. |
Method | getMergeProposals | Return matching BranchMergeProposals. |
Method | getDependentMergeProposals | Return BranchMergeProposals dependent on merging this branch. |
Method | getMergeProposalByID | Return this branch's merge proposal with this id, or None. |
Method | scheduleDiffUpdates | Create UpdatePreviewDiffJobs for this branch's targets. |
Method | markRecipesStale | Mark all recipes associated with this branch as stale. |
Method | markSnapsStale | Mark all snap packages associated with this branch as stale. |
Method | getStackedBranches | The branches that are stacked on this one. |
Method | getStackedOnBranches | The branches on which this one is stacked. |
Method | getMainlineBranchRevisions | Return the matching mainline branch revision objects. |
Attribute | code_is_browseable | Is the code in this branch accessable through codebrowse? |
Method | getCodebrowseUrl | Construct a URL for this branch in codebrowse. |
Attribute | browse_source_url | The URL of the source browser for this branch. |
Method | getCodebrowseUrlForRevision | The URL to the commit of the merge to the target branch |
Attribute | shortened_path | The shortest reasonable version of the path to this branch; as bzr_identity but without the 'lp:' prefix. |
Attribute | identity | The identity of this branch: a VCS-independent synonym for bzr_identity. |
Method | addToLaunchBag | Add information about this branch to `launchbag'. |
Method | getBlob | Get a blob by file name from this branch. |
Method | getDiff | Get the diff between two revisions in this branch. |
Method | canBeDeleted | Can this branch be deleted in its current state. |
Method | deletionRequirements | Determine what is required to delete this branch. |
Method | associatedProductSeries | Return the product series that this branch is associated with. |
Method | getProductSeriesPushingTranslations | Return sequence of product series pushing translations here. |
Method | associatedSuiteSourcePackages | Return the suite source packages that this branch is linked to. |
Method | getBranchLinks | Return a sorted list of ICanHasLinkedBranch objects. |
Method | getBranchIdentities | A list of aliases for a branch. |
Method | userCanBeSubscribed | Return if the IPerson can be subscribed to the branch. |
Method | subscribe | Subscribe this person to the branch. |
Method | getSubscription | Return the BranchSubscription for this person. |
Method | hasSubscription | Is this person subscribed to the branch? |
Method | unsubscribe | Remove the person's subscription to this branch. |
Method | getSubscriptionsByLevel | Return the subscriptions that are at the given notification levels. |
Method | getBranchRevision | Get the associated BranchRevision . |
Method | createBranchRevision | Create a new BranchRevision for this branch. |
Method | removeBranchRevisions | Remove the specified revision_ids from this Branch's revisions. |
Method | createBranchRevisionFromIDs | Create a batch of BranchRevision objects. |
Method | getTipRevision | Return the Revision associated with the last_scanned_id . |
Method | updateScannedDetails | Updates attributes associated with the scanning of the branch. |
Method | getNotificationRecipients | Return a complete INotificationRecipientSet instance. |
Method | getScannerData | Retrieve the full ancestry of a branch for the branch scanner. |
Method | getInternalBzrUrl | Get the internal URL for this branch. |
Method | getBzrBranch | Return the BzrBranch for this database Branch. |
Method | getPullURL | Return the URL used to pull the branch into the mirror area. |
Method | requestMirror | Request that this branch be mirrored on the next run of the branch |
Method | startMirroring | Signal that this branch is being mirrored. |
Method | mirrorFailed | Signal that a mirror attempt failed. |
Method | getLatestScanJob | Get the latest IBranchScanJob for this branch |
Method | checkUpgrade | Check whether an upgrade should be performed, and raise if not. |
Attribute | needs_upgrading | Whether the branch needs to be upgraded. |
Attribute | upgrade_pending | Whether a branch has had an upgrade requested. |
Method | visibleByUser | Can the specified user see this branch? |
Method | getAllowedInformationTypes | Get a list of acceptable `InformationType`s for this branch. |
Method | _createMergeProposal | Create a new BranchMergeProposal with this branch as the source. |
Inherited from IHasOwner:
Attribute | owner | The object's owner, which is an IPerson. |
Inherited from IHasBranchTarget:
Attribute | target | The branch target, as an IBranchTarget . |
Parameters | scheme | a protocol name accepted by the public code-hosting API. (As a legacy issue, 'sftp' is also accepted). |
reviewer
is a trusted reviewer.
The reviewer is trusted if they are either own the branch, or are in the team that owns the branch, or they are in the review team for the branch.
When multiple tasks are on a bug, if one of the tasks is for the branch.target, then only that task is returned. Otherwise the default bug task is returned.
Parameters | user | The user doing the search. |
status_filter | Passed onto the bug search as a constraint. |
Parameters | bug | IBug to link. |
registrant | IPerson linking the bug. |
Parameters | bug | IBug to unlink. |
user | IPerson unlinking the bug. |
Parameters | spec | ISpecification to link. |
registrant | IPerson unlinking the spec. |
Parameters | spec | ISpecification to unlink. |
user | IPerson unlinking the spec. |
They are ordered with the most recent revision first, and the list only contains those in the "leftmost tree", or in other words the revisions that match the revision history from bzrlib for this branch.
The revisions are listed as tuples of (BranchRevision
, Revision
).
Target and prerequisite branches are preloaded, along with the
related chains of stacked-on branches visible to user
.
Source and prerequisite branches are preloaded, along with the
related chains of stacked-on branches visible to user
.
Both the target_branch and the prerequisite_branch, if it is there, must be branches with the same target as the source branch.
Personal branches (a.k.a. junk branches) cannot specify landing targets.
Both the merge_target and the merge_prerequisite, if it is there, must be branches with the same target as the source branch.
Personal branches (a.k.a. junk branches) cannot specify landing targets.
Parameters | registrant | The person who is adding the landing target. |
merge_target | Must be another branch, and different to self. | |
merge_prerequisite | Optional but if it is not None, it must be another branch. | |
date_created | Used to specify the date_created value of the merge request. | |
needs_review | Used to specify the proposal is ready for review right now. | |
description | A description of the bugs fixed, features added, or refactorings. | |
review_requests | An optional list of (Person , review_type). |
Parameters | start_date | Return revisions that were committed after the start_date. |
end_date | Return revisions that were committed before the end_date | |
oldest_first | Defines the ordering of the result set. | |
Returns | A resultset of tuples for (BranchRevision, Revision) |
Parameters | extras | Zero or more path segments that will be joined onto the
end of the URL (with bzrlib.urlutils.join ). |
Add information about this branch to `launchbag'. Use this when traversing to this branch in the web UI. In particular, add information about the branch's target to the launchbag. If the branch has a product, add that; if it has a source package, add lots of information about that. :param launchbag: `ILaunchBag`.
Parameters | filename | Relative path of a file in the branch. |
revision_id | An optional revision ID. Defaults to the last scanned revision ID of the branch. | |
Returns | The blob content as a byte string. |
Parameters | new | The new revno or revision ID. |
old | The old revno or revision ID. Defaults to the parent
revision of new . | |
Returns | The diff as a byte string. |
A branch is considered deletable if it has no revisions and is not linked to any bugs, specs, productseries, or code imports.
Parameters | eager_load | If True, preload related information needed to display the deletion requirements. |
Returns | a dict of {object: (operation, reason)}, where object is the object that must be deleted or altered, operation is either "delete" or "alter", and reason is a string explaining why the object needs to be touched. |
A branch may be associated with a product series is either a branch. Also a branch can be associated with more than one product series as a branch.
These are any ProductSeries
that have this branch as their
translations_branch. It should normally be at most one, but
there's nothing stopping people from combining translations
branches.
Returns | A list of suite source packages ordered by pocket. |
There is one result for each related linked object that the branch is linked to. For example in the case where a branch is linked to the development series of a project, the link objects for both the project and the development series are returned.
The sorting uses the defined order of the linked objects where the more important links are sorted first.
A list of aliases for a branch. Returns a list of tuples of bzr identity and context object. There is at least one alias for any branch, and that is the branch itself. For linked branches, the context object is the appropriate linked object. Where a branch is linked to a product series or a suite source package, the branch is available through a number of different urls. These urls are the aliases for the branch. For example, a branch linked to the development focus of the 'fooix' project is accessible using: fooix - the linked object is the product fooix fooix/trunk - the linked object is the trunk series of fooix ~owner/fooix/name - the unique name of the branch where the linked object is the branch itself.
Parameters | person | The Person to subscribe. |
notification_level | The kinds of branch changes that cause notification. | |
max_diff_lines | The maximum number of lines of diff that may appear in a notification. | |
code_review_level | The kinds of code review activity that cause notification. | |
subscribed_by | The person who is subscribing the subscriber. Most often the subscriber themselves. | |
Returns | new or existing BranchSubscription. |
Parameters | person | The person or team to unsubscribe from the branch. |
unsubscribed_by | The person doing the unsubscribing. |
Return the subscriptions that are at the given notification levels. :param notification_levels: An iterable of `BranchSubscriptionNotificationLevel`s :return: An SQLObject query result.
BranchRevision
.
One and only one parameter is to be not None.
Parameters | sequence | The revno of the revision in the mainline history. |
revision | A Revision object. | |
revision_id | A revision id string. | |
Returns | A BranchRevision or None. |
Parameters | revision_ids | Either a single revision_id or an iterable. |
Parameters | revision_id_sequence_pairs | A sequence of (revision_id, sequence) pairs. The revision_ids are assumed to have been inserted already; no checking of this is done. |
Revision
associated with the last_scanned_id
.
Will return None if last_scanned_id is None, or if the id is not found (as in a ghost revision).
A single entry point that is called solely from the branch scanner script.
Parameters | revision | The Revision that is the tip, or None if empty. |
revision_count | The number of revisions in the history (main line revisions). |
The INotificationRecipientSet instance contains the subscribers and their subscriptions.
Retrieve the full ancestry of a branch for the branch scanner. The branch scanner script is the only place where we need to retrieve all the BranchRevision rows for a branch. Since the ancestry of some branches is into the tens of thousands we don't want to materialise BranchRevision instances for each of these. :return: tuple of three items. 1. Ancestry set of bzr revision-ids. 2. History list of bzr revision-ids. Similar to the result of bzrlib.Branch.revision_history(). 3. Dictionnary mapping bzr bzr revision-ids to the database ids of the corresponding BranchRevision rows for this branch.
It's generally better to use getBzrBranch
to open the branch
directly, as that method is safe against the branch unexpectedly being
a branch reference or stacked on something mischievous.
You can only call this if a server returned by get_ro_server
or
get_rw_server
is running.
Raises | bzrlib.url_policy_open.BadUrl | If the branch is stacked on or a reference to an unacceptable URL. |
Parameters | reason | An error message that will be displayed on the branch detail page. |
Raises | a CannotUpgradeBranch , or a subclass. |