l.c.b.DistroBrancher : class documentation

Part of lp.codehosting.branchdistro View In Hierarchy

Open a new distroseries for branch based development.

makeNewBranches will create an official package branch in the new series for every one in the old. checkNewBranches will check that a previous run of this script completed successfully -- this is only likely to be really useful if a script run died halfway through or had to be killed.

Method __init__ Construct a DistroBrancher.
Class Method fromNames Make a DistroBrancher from the names of a distro and two series.
Method checkConsistentOfficialPackageBranch Check that db_branch is a consistent official package branch.
Method makeNewBranches Make official branches in the new distroseries.
Method checkNewBranches Check the branches in the new distroseries are present and correct.
Method checkOneBranch Check a branch in the old distroseries has been copied to the new.
Method makeOneNewBranch Copy a branch to the new distroseries.
Method _existingOfficialBranches Return the collection of official branches in the old distroseries.
def __init__(self, logger, old_distroseries, new_distroseries):
Construct a DistroBrancher.

The old and new distroseries must be from the same distribution, but not the same distroseries.

ParametersloggerA Logger. Problems will be logged to this object at the WARNING level or higher; progress reports will be logged at the DEBUG level.
old_distroseriesThe distroseries that will be examined to find existing source package branches.
new_distroseriesThe distroseries that will have new official source branches made for it.
@classmethod
def fromNames(cls, logger, distribution_name, old_distroseries_name, new_distroseries_name):
Make a DistroBrancher from the names of a distro and two series.
def _existingOfficialBranches(self):
Return the collection of official branches in the old distroseries.
def checkConsistentOfficialPackageBranch(self, db_branch):
Check that db_branch is a consistent official package branch.

'Consistent official package branch' means:

  • It's a package branch (rather than a personal or junk branch).
  • It's official for its SourcePackage and no other.

This function simply returns True or False -- any problems will be logged to self.logger.

Parametersdb_branchThe IBranch to check.
ReturnsTrue if the branch is a consistent official package branch, False otherwise.
def makeNewBranches(self):
Make official branches in the new distroseries.
def checkNewBranches(self):
Check the branches in the new distroseries are present and correct.

This function checks that every official package branch in the old distroseries has a matching branch in the new distroseries and that stacking is set up as we expect on disk.

Every branch will be checked, even if some fail.

This function simply returns True or False -- any problems will be logged to self.logger.

ReturnsTrue if every branch passes the check, False otherwise.
def checkOneBranch(self, old_db_branch):
Check a branch in the old distroseries has been copied to the new.

This function checks that old_db_branch has a matching branch in the new distroseries and that stacking is set up as we expect on disk.

This function simply returns True or False -- any problems will be logged to self.logger.

Parametersold_db_branchThe branch to check.
ReturnsTrue if the branch passes the check, False otherwise.
def makeOneNewBranch(self, old_db_branch):
Copy a branch to the new distroseries.

This function makes a new database branch for the same source package as old_db_branch but in the new distroseries and then uses switch_branches to move the underlying bzr branch to the new series and replace the old branch with a branch stacked on the new series' branch.

Parametersold_db_branchThe branch to copy into the new distroseries.
RaisesBranchExistsThis will be raised if old_db_branch has already been copied to the new distroseries (in the database, at least).
API Documentation for Launchpad, generated by pydoctor at 2018-03-26 00:00:07.