/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/xml8.py

  • Committer: John Arbash Meinel
  • Date: 2008-12-11 22:34:47 UTC
  • mto: This revision was merged to the branch mainline in revision 3912.
  • Revision ID: john@arbash-meinel.com-20081211223447-wqyc0ynjs2w59r3s
Don't cache the InventoryEntry we will return, callers mutate those objects.

Show diffs side-by-side

added added

removed removed

Lines of Context:
468
468
            raise errors.UnsupportedInventoryKind(kind)
469
469
        ie.revision = revision
470
470
        if revision is not None:
471
 
            self._entry_cache[key] = ie
 
471
            # We cache a copy() because callers like to mutate objects, and
 
472
            # that would cause the item in cache to mutate as well.
 
473
            # This has a small effect on many-inventory performance, because
 
474
            # the majority fraction is spent in cache hits, not misses.
 
475
            self._entry_cache[key] = ie.copy()
472
476
 
473
477
        return ie
474
478