~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/xml5.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-12-10 17:35:37 UTC
  • mfrom: (4849.4.3 2.1.0b4-xml8)
  • Revision ID: pqm@pqm.ubuntu.com-20091210173537-7gui2z64ki7nioit
(jam) Faster conversions by enabling re-use of cached
        InventoryEntries.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
    format_num = '5'
31
31
    root_id = inventory.ROOT_ID
32
32
 
33
 
    def _unpack_inventory(self, elt, revision_id, entry_cache=None):
 
33
    def _unpack_inventory(self, elt, revision_id, entry_cache=None,
 
34
                          return_from_cache=False):
34
35
        """Construct from XML Element
35
36
        """
36
37
        root_id = elt.get('file_id') or inventory.ROOT_ID
54
55
        unpack_entry = self._unpack_entry
55
56
        byid = inv._byid
56
57
        for e in elt:
57
 
            ie = unpack_entry(e, entry_cache=entry_cache)
 
58
            ie = unpack_entry(e, entry_cache=entry_cache,
 
59
                              return_from_cache=return_from_cache)
58
60
            parent_id = ie.parent_id
59
61
            if parent_id is None:
60
62
                ie.parent_id = parent_id = root_id