/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/branch_implementations/test_branch.py

  • Committer: Aaron Bentley
  • Date: 2007-02-11 20:19:25 UTC
  • mto: (2230.3.47 branch6)
  • mto: This revision was merged to the branch mainline in revision 2290.
  • Revision ID: aaron.bentley@utoronto.ca-20070211201925-k72id2073qhbor31
Implement strict history policy

Show diffs side-by-side

added added

removed removed

Lines of Context:
674
674
        self.assertIs(None, branch.get_old_bound_location())
675
675
        branch.unbind()
676
676
        self.assertContainsRe(branch.get_old_bound_location(), '\/branch2\/$')
 
677
 
 
678
 
 
679
class TestStrict(TestCaseWithBranch):
 
680
 
 
681
    def test_strict_history(self):
 
682
        tree1 = self.make_branch_and_tree('tree1')
 
683
        try:
 
684
            tree1.branch.set_strict_history(True)
 
685
        except errors.UpgradeRequired:
 
686
            raise TestSkipped('Format does not support strict history')
 
687
        tree1.commit('empty commit')
 
688
        tree2 = tree1.bzrdir.sprout('tree2').open_workingtree()
 
689
        tree2.commit('empty commit 2')
 
690
        tree1.pull(tree2.branch)
 
691
        tree1.commit('empty commit 3')
 
692
        tree2.commit('empty commit 4')
 
693
        self.assertRaises(errors.DivergedBranches, tree1.pull, tree2.branch)
 
694
        tree2.merge_from_branch(tree1.branch)
 
695
        tree2.commit('empty commit 5')
 
696
        self.assertRaises(errors.StrictHistoryViolation, tree1.pull,
 
697
                          tree2.branch)
 
698
        tree3 = tree1.bzrdir.sprout('tree3').open_workingtree()
 
699
        tree3.merge_from_branch(tree2.branch)
 
700
        tree3.commit('empty commit 6')
 
701
        tree2.pull(tree3.branch)