~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

(jelmer) Remove Branch.revision_history() and Branch.set_revision_history().
 (Jelmer Vernooij)

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()