l.c.i.g.IGitRefView(IHasMergeProposals, IHasRecipes, IPrivacy, IInformationType) : interface documentation

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

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

IGitRef attributes that require launchpad.View permission.
Attribute repository_url The repository URL, if this is a reference in a remote repository.
Attribute name A shortened version of the full path to this reference, with any leading refs/heads/ removed.
Attribute url_quoted_name The reference name, quoted for use in URLs.
Choice object_type Undocumented
Attribute author The author of the commit pointed to by this reference.
Datetime author_date Undocumented
Attribute committer The committer of the commit pointed to by this reference.
Datetime committer_date Undocumented
Text commit_message Undocumented
TextLine display_name Display name of the reference.
Attribute displayname Copy of display_name for IHasMergeProposals views.
TextLine commit_message_first_line Undocumented
Attribute identity The identity of this reference. This will be the shortened path to the containing repository, plus a colon, plus the reference path with any leading refs/heads/ removed; for example, launchpad:master.
Attribute unique_name The unique name of this reference. This will be the unique name of the containing repository, plus a colon, plus the reference path with any leading refs/heads/ removed; for example, ~launchpad-pqm/launchpad:master.
Attribute repository_type The type of the repository containing this reference.
Attribute owner The owner of the repository containing this reference.
Attribute target The target of the repository containing this reference.
Attribute namespace The namespace of the repository containing this reference, as an IGitNamespace.
Method getCodebrowseUrl Construct a browsing URL for this Git reference.
Method getCodebrowseUrlForRevision Construct a browsing URL for this Git at the given commit
Attribute information_type The type of information contained in the repository containing this reference.
Bool private The repository containing this reference is visible only to its subscribers.
Method visibleByUser Can the specified user see the repository containing this
Method transitionToInformationType Set the information type for this reference's repository.
Attribute reviewer The person or exclusive team that is responsible for reviewing proposals and merging into this reference.
Attribute code_reviewer The reviewer if set, otherwise the owner of the repository containing this reference.
Method isPersonTrustedReviewer Return true if the reviewer is a trusted reviewer.
Attribute subscriptions GitSubscriptions associated with the repository containing this reference.
Attribute subscribers Persons subscribed to the repository containing this reference.
Method subscribe Subscribe this person to the repository containing this reference.
Method getSubscription Return the GitSubscription for this person.
Method unsubscribe Remove the person's subscription to this reference's repository.
Method getNotificationRecipients Return a complete INotificationRecipientSet instance.
Attribute landing_targets A collection of the merge proposals where this reference is the source.
Attribute landing_candidates A collection of the merge proposals where this reference is the target.
Method getPrecachedLandingTargets Return precached landing targets.
Method getPrecachedLandingCandidates Return precached landing candidates.
Method addLandingTarget Create a new BranchMergeProposal with this reference as the source.
Method createMergeProposal Create a new BranchMergeProposal with this reference as the source.
Method getMergeProposals Return matching BranchMergeProposals.
Method getDependentMergeProposals Return BranchMergeProposals dependent on merging this reference.
Attribute pending_updates Whether there are recent changes in this repository that have not yet been scanned.
Method getCommits Get commit information from this reference.
Method getLatestCommits Return a specific number of the latest commits in this ref.
Attribute has_commits Whether this reference has any commits.
Method getBlob Get a blob by file name from this reference.
Method getLatestScanJob Return the last IGitRefScanJobSource for the repository
Method rescan Force a rescan of the repository
repository_url =
The repository URL, if this is a reference in a remote repository.
name =
A shortened version of the full path to this reference, with any leading refs/heads/ removed.
url_quoted_name =
The reference name, quoted for use in URLs.
object_type =
Undocumented
author =
The author of the commit pointed to by this reference.
author_date =
Undocumented
committer =
The committer of the commit pointed to by this reference.
committer_date =
Undocumented
commit_message =
Undocumented
display_name =
Display name of the reference.
displayname =
Copy of display_name for IHasMergeProposals views.
commit_message_first_line =
Undocumented
identity =
The identity of this reference. This will be the shortened path to the containing repository, plus a colon, plus the reference path with any leading refs/heads/ removed; for example, launchpad:master.
unique_name =
The unique name of this reference. This will be the unique name of the containing repository, plus a colon, plus the reference path with any leading refs/heads/ removed; for example, ~launchpad-pqm/launchpad:master.
repository_type =
The type of the repository containing this reference.
owner =
The owner of the repository containing this reference.
target =
The target of the repository containing this reference.
namespace =
The namespace of the repository containing this reference, as an IGitNamespace.
def getCodebrowseUrl():
Construct a browsing URL for this Git reference.
def getCodebrowseUrlForRevision(commit):
Construct a browsing URL for this Git at the given commit
information_type =
The type of information contained in the repository containing this reference.
private =
The repository containing this reference is visible only to its subscribers.
def visibleByUser(user):
Can the specified user see the repository containing this reference?
def transitionToInformationType(information_type, user, verify_policy=True):
Set the information type for this reference's repository.
Parametersinformation_typeThe InformationType to transition to.
userThe IPerson who is making the change.
verify_policyCheck if the new information type complies with the IGitNamespacePolicy.
reviewer =
The person or exclusive team that is responsible for reviewing proposals and merging into this reference.
code_reviewer =
The reviewer if set, otherwise the owner of the repository containing this reference.
def isPersonTrustedReviewer(reviewer):
Return true if the reviewer is a trusted reviewer.

The reviewer is trusted if they either own the repository containing this reference, or are in the team that owns the repository, or they are in the review team for the repository.

subscriptions =
GitSubscriptions associated with the repository containing this reference.
subscribers =
Persons subscribed to the repository containing this reference.
def subscribe(person, notification_level, max_diff_lines, code_review_level, subscribed_by):
Subscribe this person to the repository containing this reference.
ParameterspersonThe Person to subscribe.
notification_levelThe kinds of repository changes that cause notification.
max_diff_linesThe maximum number of lines of diff that may appear in a notification.
code_review_levelThe kinds of code review activity that cause notification.
subscribed_byThe person who is subscribing the subscriber. Most often the subscriber themselves.
ReturnsA new or existing GitSubscription.
def getSubscription(person):
Return the GitSubscription for this person.
def unsubscribe(person, unsubscribed_by):
Remove the person's subscription to this reference's repository.
ParameterspersonThe person or team to unsubscribe from the repository.
unsubscribed_byThe person doing the unsubscribing.
def getNotificationRecipients():
Return a complete INotificationRecipientSet instance.

The INotificationRecipientSet instance contains the subscribers and their subscriptions.

landing_targets =
A collection of the merge proposals where this reference is the source.
landing_candidates =
A collection of the merge proposals where this reference is the target.
def getPrecachedLandingTargets(user):
Return precached landing targets.

Target and prerequisite repositories are preloaded.

def getPrecachedLandingCandidates(user):
Return precached landing candidates.

Source and prerequisite repositories are preloaded.

def addLandingTarget(registrant, merge_target, merge_prerequisite=None, date_created=None, needs_review=None, description=None, review_requests=None, commit_message=None):
Create a new BranchMergeProposal with this reference as the source.

Both the target and the prerequisite, if it is there, must be references whose repositories have the same target as the source.

References in personal repositories cannot specify merge proposals.

ParametersregistrantThe person who is adding the landing target.
merge_targetMust be another reference, and different to self.
merge_prerequisiteOptional, but if it is not None it must be another reference.
date_createdUsed to specify the date_created value of the merge request.
needs_reviewUsed to specify the proposal is ready for review right now.
descriptionA description of the bugs fixed, features added, or refactorings.
review_requestsAn optional list of (Person, review_type).
@operation_parameters(Reference(Interface), Reference(Interface), Bool(_('Needs review'), _('If True, the proposal needs review. Otherwise, it will be work in progress.')), Text(_('Initial comment'), _("Registrant's initial description of proposal.")), Text(_('Commit message'), _('Message to use when committing this merge.')), List(Reference(IPerson)), List(TextLine()))
@call_with(REQUEST_USER)
@export_factory_operation(Interface, )
@operation_for_version('devel')
def createMergeProposal(registrant, merge_target, merge_prerequisite=None, needs_review=None, initial_comment=None, commit_message=None, reviewers=None, review_types=None):
Create a new BranchMergeProposal with this reference as the source.

Both the merge_target and the merge_prerequisite, if it is there, must be references whose repositories have the same target as the source.

References in personal repositories cannot specify merge proposals.

@operation_parameters(List(_('A list of merge proposal statuses to filter by.'), Choice(BranchMergeProposalStatus)), List(TextLine(_('The target revision ID of the merge.'))))
@call_with(REQUEST_USER)
@operation_returns_collection_of(Interface)
@export_read_operation()
@operation_for_version('devel')
def getMergeProposals(status=None, visible_by_user=None, merged_revision_ids=None, eager_load=False):
Return matching BranchMergeProposals.
def getDependentMergeProposals(status=None, visible_by_user=None, eager_load=False):
Return BranchMergeProposals dependent on merging this reference.
pending_updates =
Whether there are recent changes in this repository that have not yet been scanned.
def getCommits(start, limit=None, stop=None, union_repository=None, start_date=None, end_date=None, handle_timeout=False, logger=None):
Get commit information from this reference.
ParametersstartThe commit to start listing from.
limitIf not None, return no more than this many commits.
stopIf not None, ignore this commit and its ancestors.
union_repositoryIf not None, resolve commit identifiers in this repository as well (particularly useful with stop).
start_dateIf not None, ignore commits before this date.
end_dateIf not None, ignore commits after this date.
handle_timeoutIf True and the backend request times out, synthesise commit information from what we have in the database.
loggerAn optional logger.
ReturnsAn iterable of commit information dicts.
def getLatestCommits(quantity=10, extended_details=False, user=None, handle_timeout=False, logger=None):
Return a specific number of the latest commits in this ref.
has_commits =
Whether this reference has any commits.
def getBlob(filename):
Get a blob by file name from this reference.
ParametersfilenameRelative path of a file in the repository.
ReturnsA binary string with the blob content.
def getLatestScanJob():
Return the last IGitRefScanJobSource for the repository
def rescan():
Force a rescan of the repository
API Documentation for Launchpad, generated by pydoctor at 2019-04-21 00:00:04.