~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: 2006-10-16 01:50:48 UTC
  • mfrom: (2078 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2080.
  • Revision ID: john@arbash-meinel.com-20061016015048-0f22df07e38093da
[merge] bzr.dev 2078

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
        """Test ancestry file when just committing."""
36
36
        tree = self.make_branch_and_memory_tree('.')
37
37
        branch = tree.branch
 
38
        tree.lock_write()
 
39
        tree.add('')
38
40
        rev_id_one = tree.commit('one')
39
41
        rev_id_two = tree.commit('two', allow_pointless=True)
 
42
        tree.unlock()
40
43
 
41
44
        self.assertAncestryEqual([None, rev_id_one, rev_id_two],
42
45
            rev_id_two, branch)
44
47
 
45
48
    def test_none_is_always_an_ancestor(self):
46
49
        tree = self.make_branch_and_memory_tree('.')
 
50
        tree.lock_write()
 
51
        tree.add('')
47
52
        # note this is tested before any commits are done.
48
53
        self.assertTrue(is_ancestor(None, None, tree.branch))
49
54
        rev_id = tree.commit('one')
 
55
        tree.unlock()
50
56
        self.assertTrue(is_ancestor(None, None, tree.branch))
51
57
        self.assertTrue(is_ancestor(rev_id, None, tree.branch))
52
58
        self.assertFalse(is_ancestor(None, rev_id, tree.branch))