def test_reconciler_finds_branch(self): a_branch = self.make_branch('a_branch') reconciler = Reconciler(a_branch.bzrdir) reconciler.reconcile() # It should have checked the repository, and the branch self.assertEqual(0, reconciler.inconsistent_parents) self.assertEqual(0, reconciler.garbage_inventories) self.assertIs(False, reconciler.fixed_branch_history)
def test_reconciler_with_no_branch(self): repo = self.make_repository('repo') reconciler = Reconciler(repo.bzrdir) reconciler.reconcile() # no inconsistent parents should have been found # but the values should have been set. self.assertEqual(0, reconciler.inconsistent_parents) # and no garbage inventories self.assertEqual(0, reconciler.garbage_inventories) self.assertIs(None, reconciler.fixed_branch_history)
def test_reweave_empty(self): # we want a repo capable format parent = bzrdir.BzrDirMetaFormat1().initialize('.') parent.create_repository(shared=True) parent.root_transport.mkdir('child') child = bzrdir.BzrDirMetaFormat1().initialize('child') self.assertRaises(errors.NoRepositoryPresent, child.open_repository) reconciler = Reconciler(child) reconciler.reconcile() # smoke test for reconcile appears to work too. reconcile(child) # no inconsistent parents should have been found # but the values should have been set. self.assertEqual(0, reconciler.inconsistent_parents) # and no garbage inventories self.assertEqual(0, reconciler.garbage_inventories)
def reconcile(): reconciler = Reconciler(d) reconciler.reconcile() return reconciler