~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_ancestry.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-01-03 18:09:01 UTC
  • mfrom: (3159.1.1 trunk)
  • Revision ID: pqm@pqm.ubuntu.com-20080103180901-w987y1ftqoh02qbm
(vila) Fix #179368 by keeping the current range hint on
        ShortReadvErrors

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
from bzrlib.branch import Branch
24
24
from bzrlib.branchbuilder import BranchBuilder
25
25
from bzrlib.revision import is_ancestor
 
26
from bzrlib.symbol_versioning import one_zero
26
27
 
27
28
 
28
29
class TestAncestry(TestCaseWithMemoryTransport):
44
45
 
45
46
    def test_none_is_ancestor_empty_branch(self):
46
47
        branch = self.make_branch('.')
47
 
        self.assertTrue(is_ancestor(None, None, branch))
 
48
        self.assertTrue(self.applyDeprecated(one_zero,
 
49
                        is_ancestor, 'null:', 'null:', branch))
48
50
 
49
51
    def test_none_is_ancestor_non_empty_branch(self):
50
52
        builder = BranchBuilder(self.get_transport())
51
53
        rev_id = builder.build_commit()
52
54
        branch = builder.get_branch()
53
 
        self.assertTrue(is_ancestor(None, None, branch))
54
 
        self.assertTrue(is_ancestor(rev_id, None, branch))
55
 
        self.assertFalse(is_ancestor(None, rev_id, branch))
 
55
        branch.lock_read()
 
56
        self.addCleanup(branch.unlock)
 
57
        self.assertTrue(self.applyDeprecated(one_zero,
 
58
                        is_ancestor, 'null:', 'null:', branch))
 
59
        self.assertTrue(self.applyDeprecated(one_zero,
 
60
                        is_ancestor, rev_id, 'null:',  branch))
 
61
        self.assertFalse(self.applyDeprecated(one_zero,
 
62
                         is_ancestor, 'null:', rev_id, branch))
56
63
 
57
64
 
58
65
# TODO: check that ancestry is updated to include indirectly merged revisions