~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/xml8.py

  • Committer: John Arbash Meinel
  • Date: 2008-12-08 18:30:41 UTC
  • mto: This revision was merged to the branch mainline in revision 3912.
  • Revision ID: john@arbash-meinel.com-20081208183041-9r88rfoms0y8cr5b
If we are going to thrash the inventory entry cache, increase its size.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
    inventory,
24
24
    lru_cache,
25
25
    revision as _mod_revision,
 
26
    trace,
26
27
    )
27
28
from bzrlib.xml_serializer import SubElement, Element, Serializer
28
29
from bzrlib.inventory import ROOT_ID, Inventory, InventoryEntry
355
356
        for e in elt:
356
357
            ie = self._unpack_entry(e)
357
358
            inv.add(ie)
 
359
        if len(inv) > _entry_cache._max_cache:
 
360
            new_len = len(inv) * 1.2
 
361
            trace.note('Resizing inventory cache to %s', new_len)
 
362
            _entry_cache.resize(new_len)
358
363
        return inv
359
364
 
360
365
    def _unpack_entry(self, elt):