/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-13 03:19:40 UTC
  • mto: This revision was merged to the branch mainline in revision 3912.
  • Revision ID: john@arbash-meinel.com-20081213031940-goymz22b10o9zu32
Change the XMLSerializer.read_inventory_from_string api.

This allows us to pass in the entry cache, rather than using a global.
This gives a lifetime to the cache, and eliminates some of the
concerns about expecting a different IE from different serializers, etc.

The cache is also cleared when the repo is unlocked.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
from bzrlib import (
21
21
    cache_utf8,
22
22
    errors,
23
 
    fifo_cache,
24
23
    inventory,
25
24
    revision as _mod_revision,
26
25
    trace,
40
39
    "<":"&lt;",
41
40
    ">":"&gt;",
42
41
    }
43
 
_entry_cache = fifo_cache.FIFOCache(10*1024)
44
42
 
45
43
 
46
44
def _ensure_utf8_re():
376
374
        if format != self.format_num:
377
375
            raise errors.UnexpectedInventoryFormat('Invalid format version %r'
378
376
                                                   % format)
379
 
        if entry_cache is None:
380
 
            entry_cache = _entry_cache
381
377
        revision_id = elt.get('revision_id')
382
378
        if revision_id is not None:
383
379
            revision_id = cache_utf8.encode(revision_id)