l.c.p.w.BranchMirrorer(object) : class documentation

Part of lp.codehosting.puller.worker View In Hierarchy

Known subclasses: lp.codehosting.puller.tests.test_errors.TestErrorCatching.CustomErrorOpener

A BranchMirrorer safely makes mirrors of branches.

A BranchMirrorer has a BranchOpenPolicy to tell it which URLs are safe to accesss and whether or not to follow branch references.

The mirrorer knows how to follow branch references, create new mirrors, update existing mirrors, determine stacked-on branches and the like.

Public methods are open and mirror.

Method __init__ Construct a branch opener with 'policy'.
Method createDestinationBranch Create a destination branch for 'source_branch'.
Method openDestinationBranch Open or create the destination branch at 'destination_url'.
Method updateBranch Bring 'dest_branch' up-to-date with 'source_branch'.
Method mirror Mirror 'source_branch' to 'destination_url'.
Method open Undocumented
def __init__(self, policy, protocol=None, log=None):
Construct a branch opener with 'policy'.
ParameterspolicyA BranchOpenPolicy that tells us what URLs are valid and similar things.
logA callable which can be called with a format string and arguments to log messages in the scheduler, or None, in which case log messages are discarded.
def createDestinationBranch(self, source_branch, destination_url):
Create a destination branch for 'source_branch'.

Creates a branch at 'destination_url' that is a mirror of 'source_branch'. Any content already at 'destination_url' will be deleted.

Parameterssource_branchThe Bazaar branch that will be mirrored.
destination_urlThe place to make the destination branch. This URL must point to a writable location.
ReturnsThe destination branch.
def openDestinationBranch(self, source_branch, destination_url):
Open or create the destination branch at 'destination_url'.
Parameterssource_branchThe Bazaar branch that will be mirrored.
destination_urlThe place to make the destination branch. This URL must point to a writable location.
ReturnsThe opened or created branch.
def updateBranch(self, source_branch, dest_branch):
Bring 'dest_branch' up-to-date with 'source_branch'.

This method pulls 'source_branch' into 'dest_branch' and sets the stacked-on URL of 'dest_branch' to match 'source_branch'.

This method assumes that 'source_branch' and 'dest_branch' both have the same format.

def mirror(self, source_branch, destination_url):
Mirror 'source_branch' to 'destination_url'.
def open(self, url):
Undocumented
API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.