l.c.i.b.IBranchHostingClient(Interface) : interface documentation

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

Interface for the internal API provided by Loggerhead.
Method getDiff Get the diff between two revisions.
Method getInventory Get information on files in a directory.
Method getBlob Get a blob by file name from a branch.
def getDiff(branch_id, new, old=None, context_lines=None, logger=None):
Get the diff between two revisions.
Parametersbranch_idThe ID of the branch.
newThe new revno or revision ID.
oldThe old revno or revision ID. Defaults to the parent revision of new.
context_linesInclude this number of lines of context around each hunk.
loggerAn optional logger.
ReturnsThe diff between old and new as a byte string.
RaisesValueErrorif old or new is ill-formed.
BranchHostingFaultif the API returned an error.
def getInventory(branch_id, dirname, rev=None, logger=None):
Get information on files in a directory.
Parametersbranch_idThe ID of the branch.
dirnameThe name of the directory, relative to the root of the branch.
revAn optional revno or revision ID. Defaults to 'head:'.
loggerAn optional logger.
ReturnsThe directory inventory as a dict: see loggerhead.controllers.inventory_ui for details.
RaisesValueErrorif rev is ill-formed.
BranchFileNotFoundif the directory does not exist.
BranchHostingFaultif the API returned some other error.
def getBlob(branch_id, file_id, rev=None, logger=None):
Get a blob by file name from a branch.
Parametersbranch_idThe ID of the branch.
file_idThe file ID of the file. (getInventory may be useful to retrieve this.)
revAn optional revno or revision ID. Defaults to 'head:'.
loggerAn optional logger.
ReturnsThe blob content as a byte string.
RaisesValueErrorif rev is ill-formed.
BranchFileNotFoundif the directory does not exist.
BranchHostingFaultif the API returned some other error.
API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.