~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/xml_serializer.py

  • Committer: Ian Clatworthy
  • Date: 2008-12-23 07:47:43 UTC
  • mfrom: (3916 +trunk)
  • mto: (3586.1.28 views-ui)
  • mto: This revision was merged to the branch mainline in revision 4030.
  • Revision ID: ian.clatworthy@canonical.com-20081223074743-t942gwabt937o693
merge bzr.dev r3916

Show diffs side-by-side

added added

removed removed

Lines of Context:
59
59
    def write_inventory_to_string(self, inv):
60
60
        raise NotImplementedError(self.write_inventory_to_string)
61
61
 
62
 
    def read_inventory_from_string(self, xml_string, revision_id=None):
 
62
    def read_inventory_from_string(self, xml_string, revision_id=None,
 
63
                                   entry_cache=None):
63
64
        """Read xml_string into an inventory object.
64
65
 
65
66
        :param xml_string: The xml to read.
70
71
            serialised without a revision identifier can be given the right
71
72
            revision id (but not for working tree inventories where users can
72
73
            edit the data without triggering checksum errors or anything).
 
74
        :param entry_cache: An optional cache of InventoryEntry objects. If
 
75
            supplied we will look up entries via (file_id, revision_id) which
 
76
            should map to a valid InventoryEntry (File/Directory/etc) object.
73
77
        """
74
78
        try:
75
 
            return self._unpack_inventory(fromstring(xml_string), revision_id)
 
79
            return self._unpack_inventory(fromstring(xml_string), revision_id,
 
80
                                          entry_cache=entry_cache)
76
81
        except ParseError, e:
77
82
            raise errors.UnexpectedInventoryFormat(e)
78
83