~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_branch/test_check.py

  • Committer: Jelmer Vernooij
  • Date: 2012-04-16 11:08:11 UTC
  • mfrom: (6521 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6522.
  • Revision ID: jelmer@samba.org-20120416110811-0y996ihqy9o2bb1t
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
 
45
45
        r5 = tree.commit('five')
46
46
        # Now, try to set an invalid history
47
 
        try:
48
 
            self.applyDeprecated(deprecated_in((2, 4, 0)),
49
 
                tree.branch.set_revision_history, [r1, r2b, r5])
50
 
            if tree.branch.last_revision_info() != (3, r5):
51
 
                # RemoteBranch silently corrects an impossible revision
52
 
                # history given to set_revision_history.  It can be tricked
53
 
                # with set_last_revision_info though.
54
 
                tree.branch.set_last_revision_info(3, r5)
55
 
        except errors.NotLefthandHistory:
56
 
            # Branch5 allows set_revision_history to be wrong
57
 
            # Branch6 raises NotLefthandHistory, but we can force bogus stuff
58
 
            # with set_last_revision_info
 
47
        if getattr(tree.branch, "_set_revision_history", None) is not None:
 
48
            tree.branch._set_revision_history([r1, r2b, r5])
 
49
        else:
59
50
            tree.branch.set_last_revision_info(3, r5)
60
51
 
61
52
        tree.lock_read()