~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Tarmac
  • Author(s): Vincent Ladeuil, Patch Queue Manager, Jelmer Vernooij
  • Date: 2017-01-17 16:20:41 UTC
  • mfrom: (6619.1.2 trunk)
  • Revision ID: tarmac-20170117162041-oo62uk1qsmgc9j31
Merge 2.7 into trunk including fixes for bugs #1622039, #1644003, #1579093 and #1645017. [r=vila]

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
from StringIO import StringIO
20
20
 
21
21
from bzrlib import errors, tests, ui
 
22
from bzrlib.symbol_versioning import deprecated_in
22
23
from bzrlib.tests.per_branch import TestCaseWithBranch
23
24
 
24
25
 
43
44
 
44
45
        r5 = tree.commit('five')
45
46
        # Now, try to set an invalid history
46
 
        try:
47
 
            tree.branch.set_revision_history([r1, r2b, r5])
48
 
            if tree.branch.last_revision_info() != (3, r5):
49
 
                # RemoteBranch silently corrects an impossible revision
50
 
                # history given to set_revision_history.  It can be tricked
51
 
                # with set_last_revision_info though.
52
 
                tree.branch.set_last_revision_info(3, r5)
53
 
        except errors.NotLefthandHistory:
54
 
            # Branch5 allows set_revision_history to be wrong
55
 
            # Branch6 raises NotLefthandHistory, but we can force bogus stuff
56
 
            # 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:
57
50
            tree.branch.set_last_revision_info(3, r5)
58
51
 
59
52
        tree.lock_read()