~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_ancestry.py

  • Committer: John Arbash Meinel
  • Date: 2007-11-30 14:52:30 UTC
  • mto: This revision was merged to the branch mainline in revision 3061.
  • Revision ID: john@arbash-meinel.com-20071130145230-njpq31mmf39l2zow
deprecate revision.is_ancestor, update the callers and the tests.

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 zero_ninetythree
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('null:', 'null:', branch))
 
48
        self.assertTrue(self.applyDeprecated(zero_ninetythree,
 
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())
52
54
        branch = builder.get_branch()
53
55
        branch.lock_read()
54
56
        self.addCleanup(branch.unlock)
55
 
        self.assertTrue(is_ancestor('null:', 'null:', branch))
56
 
        self.assertTrue(is_ancestor(rev_id, 'null:',  branch))
57
 
        self.assertFalse(is_ancestor('null:', rev_id, branch))
 
57
        self.assertTrue(self.applyDeprecated(zero_ninetythree,
 
58
                        is_ancestor, 'null:', 'null:', branch))
 
59
        self.assertTrue(self.applyDeprecated(zero_ninetythree,
 
60
                        is_ancestor, rev_id, 'null:',  branch))
 
61
        self.assertFalse(self.applyDeprecated(zero_ninetythree,
 
62
                         is_ancestor, 'null:', rev_id, branch))
58
63
 
59
64
 
60
65
# TODO: check that ancestry is updated to include indirectly merged revisions