def getUpgrader(self, bzr_branch, branch): """Return an upgrader for the specified branches. :param bzr_branch: the bzr branch to use. :param branch: The DB branch to use. """ return Upgrader(branch, self.getTargetDir(bzr_branch), logging.getLogger(), bzr_branch)
def test_invalid_stacking(self): """Upgrade tolerates branches stacked on different-format branches.""" self.useBzrBranches(direct_database=True) target, target_tree = self.create_branch_and_tree(format='1.6') trunk, trunk_tree = self.create_branch_and_tree(format='2a') force_stacked_on_url(target_tree.branch, trunk_tree.branch.base) Upgrader(target, self.getTargetDir(target_tree.branch), logging.getLogger())
def prepare(self): """Prepare to run the script.""" self.useBzrBranches(direct_database=True) branch, tree = self.create_branch_and_tree(format='pack-0.92') tree.commit('foo', committer='*****@*****.**') with person_logged_in(branch.owner): branch_changed(branch, tree.branch) target = self.useFixture(TempDir( rootdir=dirname(config.codehosting.mirrored_branches_root))).path upgrader = Upgrader(branch, target, logging.getLogger(), tree.branch) return upgrader