~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: 2006-10-15 16:32:29 UTC
  • mfrom: (1731.1.67 unique-root)
  • Revision ID: pqm@pqm.ubuntu.com-20061015163229-648b1f2ebe692136
New trees have unique root ids

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))