~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Patch Queue Manager
  • Date: 2015-12-17 18:39:00 UTC
  • mfrom: (6606.1.2 fix-float)
  • Revision ID: pqm@pqm.ubuntu.com-20151217183900-0719du2uv1kwu3lc
(vila) Inline testtools private method to fix an issue in xenial (the
 private implementation has changed in an backward incompatible way).
 (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
"""Tests for branch implementations - test reconcile() functionality"""
18
18
 
19
19
from bzrlib import errors, reconcile
 
20
from bzrlib.branch import BzrBranch
20
21
from bzrlib.symbol_versioning import deprecated_in
21
22
from bzrlib.tests.per_branch import TestCaseWithBranch
 
23
from bzrlib.tests import TestNotApplicable
22
24
 
23
25
 
24
26
class TestBranchReconcile(TestCaseWithBranch):
25
27
 
26
28
    def test_reconcile_fixes_invalid_revhistory(self):
 
29
        if not isinstance(self.branch_format, BzrBranch):
 
30
            raise TestNotApplicable("test only applies to bzr formats")
27
31
        # Different formats have different ways of handling invalid revision
28
32
        # histories, so the setup portion is customized
29
33
        tree = self.make_branch_and_tree('test')
75
79
 
76
80
    def test_reconcile_handles_ghosts_in_revhistory(self):
77
81
        tree = self.make_branch_and_tree('test')
 
82
        if not tree.branch.repository._format.supports_ghosts:
 
83
            raise TestNotApplicable("repository format does not support ghosts")
78
84
        tree.set_parent_ids(["spooky"], allow_leftmost_as_ghost=True)
79
85
        r1 = tree.commit('one')
80
86
        r2 = tree.commit('two')
81
87
        tree.branch.set_last_revision_info(2, r2)
82
88
 
83
89
        reconciler = tree.branch.reconcile()
84
 
        self.assertEquals([r1, r2], tree.branch.revision_history())
 
90
        self.assertEquals(r2, tree.branch.last_revision())