~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/xml4.py

  • Committer: John Arbash Meinel
  • Date: 2010-02-17 17:11:16 UTC
  • mfrom: (4797.2.17 2.1)
  • mto: (4797.2.18 2.1)
  • mto: This revision was merged to the branch mainline in revision 5055.
  • Revision ID: john@arbash-meinel.com-20100217171116-h7t9223ystbnx5h8
merge bzr.2.1 in preparation for NEWS entry.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2006 Canonical Ltd
 
1
# Copyright (C) 2005-2010 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
63
63
        return e
64
64
 
65
65
 
66
 
    def _unpack_inventory(self, elt, revision_id=None, entry_cache=None):
 
66
    def _unpack_inventory(self, elt, revision_id=None, entry_cache=None,
 
67
                          return_from_cache=False):
67
68
        """Construct from XML Element
68
69
 
69
70
        :param revision_id: Ignored parameter used by xml5.
71
72
        root_id = elt.get('file_id') or ROOT_ID
72
73
        inv = Inventory(root_id)
73
74
        for e in elt:
74
 
            ie = self._unpack_entry(e, entry_cache=entry_cache)
 
75
            ie = self._unpack_entry(e, entry_cache=entry_cache,
 
76
                                    return_from_cache=return_from_cache)
75
77
            if ie.parent_id == ROOT_ID:
76
78
                ie.parent_id = root_id
77
79
            inv.add(ie)
78
80
        return inv
79
81
 
80
82
 
81
 
    def _unpack_entry(self, elt, entry_cache=None):
 
83
    def _unpack_entry(self, elt, entry_cache=None, return_from_cache=False):
82
84
        ## original format inventories don't have a parent_id for
83
85
        ## nodes in the root directory, but it's cleaner to use one
84
86
        ## internally.