~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/test_ancestry.py

  • Committer: Martin Pool
  • Date: 2005-09-22 13:32:02 UTC
  • Revision ID: mbp@sourcefrog.net-20050922133202-347cfd35d2941dd5
- simple weave-based annotate code (not complete)

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
from bzrlib.selftest import TestCase, TestCaseInTempDir
23
23
from bzrlib.branch import Branch
24
 
from bzrlib.revision import is_ancestor
25
24
 
26
25
 
27
26
class TestAncestry(TestCaseInTempDir):
28
 
 
29
27
    def test_straightline_ancestry(self):
30
28
        """Test ancestry file when just committing."""
31
 
        b = Branch.initialize('.')
 
29
        b = Branch('.', init=True)
32
30
 
33
31
        b.commit(message='one',
34
32
                 allow_pointless=True,
40
38
 
41
39
        ancs = b.get_ancestry('tester@foo--2')
42
40
 
43
 
    def test_none_is_always_an_ancestor(self):
44
 
        b = Branch.initialize('.')
45
 
        # note this is tested before any commits are done.
46
 
        self.assertEqual(True, is_ancestor(None, None, b))
47
 
        b.commit(message='one',
48
 
                 allow_pointless=True,
49
 
                 rev_id='tester@foo--1')
50
 
        self.assertEqual(True, is_ancestor(None, None, b))
51
 
        self.assertEqual(True, is_ancestor('tester@foo--1', None, b))
52
 
        self.assertEqual(False, is_ancestor(None, 'tester@foo--1', b))
53
41
 
54
42
 
55
43
# TODO: check that ancestry is updated to include indirectly merged revisions
 
44
        
 
45
        
 
46
 
 
47
if __name__ == '__main__':
 
48
    import unittest
 
49
    sys.exit(unittest.main())