~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_ancestry.py

  • Committer: Alexander Belchenko
  • Date: 2007-08-10 09:04:38 UTC
  • mto: This revision was merged to the branch mainline in revision 2694.
  • Revision ID: bialix@ukr.net-20070810090438-0835xdz0rl8825qv
fixes after Ian's review

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
27
26
 
28
27
 
29
28
class TestAncestry(TestCaseWithMemoryTransport):
45
44
 
46
45
    def test_none_is_ancestor_empty_branch(self):
47
46
        branch = self.make_branch('.')
48
 
        self.assertTrue(self.applyDeprecated(one_zero,
49
 
                        is_ancestor, 'null:', 'null:', branch))
 
47
        self.assertTrue(is_ancestor('null:', 'null:', branch))
50
48
 
51
49
    def test_none_is_ancestor_non_empty_branch(self):
52
50
        builder = BranchBuilder(self.get_transport())
53
51
        rev_id = builder.build_commit()
54
52
        branch = builder.get_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))
 
53
        self.assertTrue(is_ancestor('null:', 'null:', branch))
 
54
        self.assertTrue(is_ancestor(rev_id, 'null:',  branch))
 
55
        self.assertFalse(is_ancestor('null:', rev_id, branch))
63
56
 
64
57
 
65
58
# TODO: check that ancestry is updated to include indirectly merged revisions