~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/benchmarks/tree_creator/kernel_like.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-09-14 03:16:09 UTC
  • mfrom: (2817.2.2 add_inventory)
  • Revision ID: pqm@pqm.ubuntu.com-20070914031609-ccdhl0ebzrohpa1t
(robertc) Reduce the time to serialise inventories by 20 percent and align the api for knit insertion. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
210
210
                                                 link_bzr=True,
211
211
                                                 hot_cache=False)
212
212
        tree = creator.create('.')
213
 
        return tree.basis_tree().inventory
 
213
        basis = tree.basis_tree()
 
214
        basis.lock_read()
 
215
        try:
 
216
            return basis.inventory
 
217
        finally:
 
218
            basis.unlock()
214
219
 
215
220
    def _open_cached(self, cache_dir):
216
221
        f = open(cache_dir + '/inventory', 'rb')