~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Vincent Ladeuil
  • Date: 2012-03-13 17:25:29 UTC
  • mfrom: (6499 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6501.
  • Revision ID: v.ladeuil+lp@free.fr-20120313172529-i0suyjnepsor25i7
Merge trunk

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