Part of lp.code.interfaces.gitrepository View In Hierarchy
Known subclasses: lp.code.interfaces.webservice.IGitRepository
Int | id | Undocumented |
Attribute | namespace | The namespace of this repository, as an IGitNamespace . |
Attribute | code_reviewer | The reviewer if set, otherwise the owner of the repository. |
Attribute | shortened_path | The shortest reasonable version of the path to this repository. |
Method | isPersonTrustedReviewer | Return true if the reviewer is a trusted reviewer. |
Attribute | identity | The identity of this repository: a VCS-independent synonym for git_identity. |
Attribute | branches_by_date | The branch references present in this repository, ordered by last commit date. |
Attribute | rules | The access rules for this repository. |
Attribute | grants | The access grants for this repository. |
Method | getRefByPath | Look up a single reference in this repository by path. |
Method | createOrUpdateRefs | Create or update a set of references in this repository. |
Method | removeRefs | Remove a set of references in this repository. |
Method | planRefChanges | Plan ref changes based on information from the hosting service. |
Method | fetchRefCommits | Fetch commit information from the hosting service for a set of refs. |
Method | synchroniseRefs | Synchronise references with those from the hosting service. |
Method | setOwnerDefault | Set whether this repository is the default for its owner-target. |
Method | setTargetDefault | Set whether this repository is the default for its target. |
Method | getCodebrowseUrl | Construct a browsing URL for this Git repository. |
Method | getCodebrowseUrlForRevision | The URL to the commit of the merge to the target branch |
Method | getLatestScanJob | Return the last IGitRefScanJobSource for this repository |
Method | visibleByUser | Can the specified user see this repository? |
Method | getAllowedInformationTypes | Get a list of acceptable `InformationType`s for this repository. |
Method | getInternalPath | Get the internal path to this repository. |
Method | getRepositoryDefaults | Return a sorted list of ICanHasDefaultGitRepository objects. |
Method | getRepositoryIdentities | A list of aliases for a repository. |
Method | userCanBeSubscribed | Return True if the IPerson can be subscribed to the repository. |
Method | subscribe | Subscribe this person to the repository. |
Method | getSubscription | Return the GitSubscription for this person. |
Method | hasSubscription | Is this person subscribed to the repository? |
Method | unsubscribe | Remove the person's subscription to this repository. |
Method | getSubscriptionsByLevel | Return the subscriptions that are at the given notification levels. |
Method | getNotificationRecipients | Return a complete INotificationRecipientSet instance. |
Attribute | landing_targets | A collection of the merge proposals where this repository is the source. |
Attribute | landing_candidates | A collection of the merge proposals where this repository is the target. |
Method | getPrecachedLandingTargets | Return precached landing targets. |
Method | getPrecachedLandingCandidates | Return precached landing candidates. |
Method | getMergeProposals | Return matching BranchMergeProposals. |
Method | getMergeProposalByID | Return this repository's merge proposal with this id, or None. |
Method | isRepositoryMergeable | Is the other repository mergeable into this one (or vice versa)? |
Attribute | pending_updates | Whether there are recent changes in this repository that have not yet been scanned. |
Method | updateMergeCommitIDs | Update commit SHA1s of merge proposals for this repository. |
Method | updateLandingTargets | Update landing targets (MPs where this repository is the source). |
Method | markRecipesStale | Mark recipes associated with this repository as stale. |
Method | markSnapsStale | Mark snap packages associated with this repository as stale. |
Method | detectMerges | Detect merges of landing candidates. |
Method | getBlob | Get a blob by file name from this repository. |
Method | getDiff | Get the diff between two commits in this repository. |
Method | getRule | Get the access rule for this repository with a given pattern. |
Method | getActivity | Get activity log entries for this repository. |
Method | getPrecachedActivity | Activity log entries are preloaded. |
Method | issueAccessToken | Issue an access token for this repository. |
reviewer
is a trusted reviewer.
The reviewer is trusted if they either own the repository, or are in the team that owns the repository, or they are in the review team for the repository.
Parameters | path | A string to look up as a path. |
Returns | An IGitRef , or None. |
Parameters | refs_info | A dict mapping ref paths to
{"sha1": sha1, "type": GitObjectType }. |
get_objects | Return the created/updated references. | |
logger | An optional logger. | |
Returns | A list of the created/updated references if get_objects, otherwise None. |
Unknown Field: params | paths | An iterable of paths. |
Parameters | hosting_path | A path on the hosting service. |
logger | An optional logger. | |
Returns | A dict of refs to create or update as appropriate, mapping ref paths to dictionaries of their fields; and a set of ref paths to remove. |
Parameters | hosting_path | A path on the hosting service. |
refs | A dict mapping ref paths to dictionaries of their fields; the field dictionaries will be updated with any detailed commit information that is available. | |
logger | An optional logger. |
Parameters | refs_to_upsert | A dictionary mapping ref paths to dictionaries of their fields; these refs will be created or updated as appropriate. |
refs_to_remove | A set of ref paths to remove. | |
logger | An optional logger. |
This is for internal use; the caller should ensure permission to edit the owner, should arrange to remove any existing owner-target default, and should check that this repository is attached to the desired target.
Parameters | value | True if this repository should be the owner-target default, otherwise False. |
This is for internal use; the caller should ensure permission to edit the target, should arrange to remove any existing target default, and should check that this repository is attached to the desired target.
Parameters | value | True if this repository should be the target default, otherwise False. |
Get a list of acceptable `InformationType`s for this repository. If the user is a Launchpad admin, any type is acceptable.
This is used on the storage backend.
ICanHasDefaultGitRepository
objects.
There is one result for each related object for which this repository is the default. For example, in the case where a repository is the default for a project and is also its owner's default repository for that project, the objects for both the project and the person-project are returned.
More important related objects are sorted first.
A list of aliases for a repository. Returns a list of tuples of path and context object. There is at least one alias for any repository, and that is the repository itself. For default repositories, the context object is the appropriate default object. Where a repository is the default for a product or a distribution source package, the repository is available through a number of different URLs. These URLs are the aliases for the repository. For example, a repository which is the default for the 'fooix' project and which is also its owner's default repository for that project is accessible using: fooix - the context object is the project fooix ~fooix-owner/fooix - the context object is the person-project ~fooix-owner and fooix ~fooix-owner/fooix/+git/fooix - the unique name of the repository where the context object is the repository itself.
Parameters | person | The Person to subscribe. |
notification_level | The kinds of repository 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 | A new or existing GitSubscription . |
GitSubscription
for this person.Parameters | person | The person or team to unsubscribe from the repository. |
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: A `ResultSet`.
The INotificationRecipientSet instance contains the subscribers and their subscriptions.
Target and prerequisite repositories are preloaded.
Source and prerequisite repositories are preloaded.
Update commit SHA1s of merge proposals for this repository. The *_git_commit_sha1 columns of merge proposals are stored explicitly in order that merge proposals are still meaningful after associated refs have been deleted. However, active merge proposals where the refs in question still exist should have these columns kept up to date.
Update landing targets (MPs where this repository is the source). For each merge proposal, create `UpdatePreviewDiffJob`s. :param paths: A list of reference paths. Any merge proposals whose source is this repository and one of these paths will have their diffs updated.
Parameters | paths | A list of reference paths. Any recipes that include
an entry that points to this repository and that have a
revspec that is one of these paths will be marked as stale. |
Parameters | paths | A list of reference paths. Any snap packages that include an entry that points to this repository and that are based on one of these paths will be marked as stale. |
Parameters | paths | A list of reference paths. Any merge proposals whose target is this repository and one of these paths will be checked. |
logger | An optional logger. |
Parameters | filename | Relative path of a file in the repository. |
rev | An optional revision. Defaults to 'HEAD'. | |
Returns | A binary string with the blob content. |
Parameters | old | The OID of the old commit. |
new | The OID of the new commit. | |
Returns | The diff as a binary string. |
Parameters | ref_pattern | The reference pattern that the rule should have. |
Returns | An IGitRule , or None. |
Parameters | changed_after | If supplied, only return entries for changes made after this date. |
Returns | A ResultSet of IGitActivity . |
Parameters | changed_after | If supplied, only return entries for changes made after this date. |
Returns | A ResultSet of IGitActivity . |
Access tokens can be used to push to this repository over HTTPS. They are only valid for a single repository, and have a short expiry period (currently one week), so at the moment they are only suitable in some limited situations.
This interface is experimental, and may be changed or removed without notice.
Returns | A serialised macaroon. |