~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_memorytree.py

  • Committer: John Arbash Meinel
  • Date: 2007-05-04 18:59:36 UTC
  • mto: This revision was merged to the branch mainline in revision 2643.
  • Revision ID: john@arbash-meinel.com-20070504185936-1mjdoqmtz74xe5mg
A C implementation of _fields_to_entry_0_parents drops the time from 400ms to 330ms for a 21k-entry tree

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
            tree.get_file(tree.path2id('foo')).read())
53
53
        tree.unlock()
54
54
 
55
 
    def test_get_root_id(self):
56
 
        branch = self.make_branch('branch')
57
 
        tree = MemoryTree.create_on_branch(branch)
58
 
        tree.lock_write()
59
 
        try:
60
 
            tree.add([''])
61
 
            self.assertIsNot(None, tree.get_root_id())
62
 
        finally:
63
 
            tree.unlock()
64
 
 
65
55
    def test_lock_tree_write(self):
66
56
        """Check we can lock_tree_write and unlock MemoryTrees."""
67
57
        branch = self.make_branch('branch')
143
133
        tree.unlock()
144
134
        # and we should have a revision that is accessible outside the tree lock
145
135
        revtree = tree.branch.repository.revision_tree(revision_id)
146
 
        revtree.lock_read()
147
 
        self.addCleanup(revtree.unlock)
148
136
        self.assertEqual('barshoom', revtree.get_file('foo-id').read())
149
137
 
150
138
    def test_unversion(self):