l.c.i.b.IBranchEdit(IWebhookTarget) : interface documentation

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

Known subclasses: lp.code.interfaces.webservice.IBranch

IBranch attributes that require launchpad.Edit permission.
Method setOwner Set the owner of the branch to be new_owner.
Method setTarget Set the target of the branch to be project or source_package.
Method requestUpgrade Create an IBranchUpgradeJob to upgrade this branch.
Method branchChanged Record that a branch has been changed.
Method destroySelf Delete the specified branch.

Inherited from IWebhookTarget:

List valid_webhook_event_types Valid event types for this object type.
List default_webhook_event_types Default event types for new webhooks attached to this object type.
Method newWebhook Create a new webhook.
@call_with(REQUEST_USER)
@operation_parameters(Reference(_('The new owner of the branch.'), IPerson))
@export_write_operation()
@operation_for_version('beta')
def setOwner(new_owner, user):
Set the owner of the branch to be new_owner.
@call_with(REQUEST_USER)
@operation_parameters(Reference(_('The project the branch belongs to.'), Interface, False), Reference(_('The source package the branch belongs to.'), Interface, False))
@export_write_operation()
@operation_for_version('beta')
def setTarget(user, project=None, source_package=None):
Set the target of the branch to be project or source_package.

Only one of project or source_package can be set, and if neither is set, the branch gets moved into the junk namespace of the branch owner.

RaisesBranchTargetError if both project and source_package are set, or if either the project or source_package fail to be adapted to an IBranchTarget.
def requestUpgrade(requester):
Create an IBranchUpgradeJob to upgrade this branch.
def branchChanged(stacked_on_url, last_revision_id, control_format, branch_format, repository_format):
Record that a branch has been changed.

This method records the stacked on branch tip revision id and format or the branch and creates a scan job if the tip revision id has changed.

Parametersstacked_on_urlThe unique name of the branch this branch is stacked on, or '' if this branch is not stacked.
last_revision_idThe tip revision ID of the branch.
control_formatThe entry from ControlFormat for the branch.
branch_formatThe entry from BranchFormat for the branch.
repository_formatThe entry from RepositoryFormat for the branch.
@call_with(True)
@export_destructor_operation()
@operation_for_version('beta')
def destroySelf(break_references=False):
Delete the specified branch.

BranchRevisions associated with this branch will also be deleted.

Parametersbreak_referencesIf supplied, break any references to this branch by deleting items with mandatory references and NULLing other references.
RaisesCannotDeleteBranch if the branch cannot be deleted.
API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.