~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/xml5.py

  • Committer: John Arbash Meinel
  • Date: 2007-02-18 00:22:24 UTC
  • mto: This revision was merged to the branch mainline in revision 2298.
  • Revision ID: john@arbash-meinel.com-20070218002224-nfsw9ubivr178ahn
Switch all apis over to utf8 file ids. All tests pass

Show diffs side-by-side

added added

removed removed

Lines of Context:
275
275
        """
276
276
        assert elt.tag == 'inventory'
277
277
        root_id = elt.get('file_id') or ROOT_ID
 
278
        root_id = _get_utf8_or_ascii(root_id)
 
279
 
278
280
        format = elt.get('format')
279
281
        if format is not None:
280
282
            if format != '5':
299
301
        get_cached = _get_utf8_or_ascii
300
302
 
301
303
        parent_id = elt.get('parent_id')
302
 
        # TODO: jam 20060817 At present, caching file ids costs us too 
303
 
        #       much time. It slows down overall read performances from
304
 
        #       approx 500ms to 700ms. And doesn't improve future reads.
305
 
        #       it might be because revision ids and file ids are mixing.
306
 
        #       Consider caching *just* the file ids, for a limited period
307
 
        #       of time.
308
 
        #parent_id = get_cached(parent_id)
309
 
        #file_id = get_cached(elt.get('file_id'))
310
 
        file_id = elt.get('file_id')
 
304
        if parent_id is not None:
 
305
            parent_id = get_cached(parent_id)
 
306
        file_id = get_cached(elt.get('file_id'))
311
307
 
312
308
        if kind == 'directory':
313
309
            ie = inventory.InventoryDirectory(file_id,