l.c.i.g.IGitHostingClient(Interface) : interface documentation

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

Interface for the internal API provided by the Git hosting service.
Method create Create a Git repository.
Method getProperties Get properties of this repository.
Method setProperties Set properties of this repository.
Method getRefs Get all refs in this repository.
Method getCommits Get details of a list of commits.
Method getLog Get commit log information.
Method getDiff Get the diff between two commits.
Method getMergeDiff Get the merge preview diff between two commits.
Method detectMerges Detect merges of any of 'sources' into 'target'.
Method delete Delete a repository.
Method getBlob Get a blob by file name from a repository.
def create(path, clone_from=None):
Create a Git repository.
ParameterspathPhysical path of the new repository on the hosting service.
clone_fromIf not None, clone the new repository from this other physical path.
def getProperties(path):
Get properties of this repository.
ParameterspathPhysical path of the repository on the hosting service.
ReturnsA dict of properties.
def setProperties(path, **props):
Set properties of this repository.
ParameterspathPhysical path of the repository on the hosting service.
propsProperties to set.
def getRefs(path, exclude_prefixes=None):
Get all refs in this repository.
ParameterspathPhysical path of the repository on the hosting service.
exclude_prefixesAn optional list of ref prefixes to exclude.
ReturnsA dict mapping ref paths to dicts representing the objects they point to.
def getCommits(path, commit_oids, logger=None):
Get details of a list of commits.
ParameterspathPhysical path of the repository on the hosting service.
commit_oidsA list of commit OIDs.
loggerAn optional logger.
ReturnsA list of dicts each of which represents one of the requested commits. Non-existent commits will be omitted.
def getLog(path, start, limit=None, stop=None, logger=None):
Get commit log information.
ParameterspathPhysical path of the repository on the hosting service.
startThe commit to start listing from.
limitIf not None, return no more than this many commits.
stopIf not None, ignore this commit and its ancestors.
loggerAn optional logger.
ReturnsA list of dicts each of which represents a commit from the start commit's history.
def getDiff(path, old, new, common_ancestor=False, context_lines=None, logger=None):
Get the diff between two commits.
ParameterspathPhysical path of the repository on the hosting service.
oldThe OID of the old commit.
newThe OID of the new commit.
common_ancestorIf True, return the symmetric or common ancestor diff, equivalent to git diff $(git-merge-base OLD NEW) NEW.
context_linesInclude this number of lines of context around each hunk.
loggerAn optional logger.
ReturnsA dict mapping 'commits' to a list of commits between 'old' and 'new' (formatted as with getCommits) and 'patch' to the text of the diff between 'old' and 'new'.
def getMergeDiff(path, base, head, logger=None):
Get the merge preview diff between two commits.
ParameterspathPhysical path of the repository on the hosting service.
baseThe OID of the base commit.
headThe OID of the commit that we want to merge into 'base'.
loggerAn optional logger.
ReturnsA dict mapping 'commits' to a list of commits between 'base' and 'head' (formatted as with getCommits), 'patch' to the text of the diff between 'base' and 'head', and 'conflicts' to a list of conflicted paths.
def detectMerges(path, target, sources, logger=None):
Detect merges of any of 'sources' into 'target'.
ParameterspathPhysical path of the repository on the hosting service.
targetThe OID of the merge proposal target commit.
sourcesThe OIDs of the merge proposal source commits.
loggerAn optional logger.
ReturnsA dict mapping merged commit OIDs from 'sources' to the first commit OID in the left-hand (first parent only) history of 'target' that is a descendant of the corresponding source commit. Unmerged commits are omitted.
def delete(path, logger=None):
Delete a repository.
ParameterspathPhysical path of the repository on the hosting service.
loggerAn optional logger.
def getBlob(path, filename, rev=None, logger=None):
Get a blob by file name from a repository.
ParameterspathPhysical path of the repository on the hosting service.
filenameRelative path of a file in the repository.
revAn optional revision. Defaults to 'HEAD'.
loggerAn optional logger.
ReturnsA binary string with the blob content.
API Documentation for Launchpad, generated by pydoctor at 2019-05-20 00:00:04.