/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/xml_serializer.py

  • Committer: Benoît Pierre
  • Date: 2009-02-24 00:25:32 UTC
  • mfrom: (4035 +trunk)
  • mto: (4056.1.1 trunk2)
  • mto: This revision was merged to the branch mainline in revision 4058.
  • Revision ID: benoit.pierre@gmail.com-20090224002532-i2f64ou15pa7if2y
Merge with upstream.

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
 
117
122
    }
118
123
def _escape_replace(match, map=escape_map):
119
124
    return map[match.group()]
120
 
 
 
125
 
121
126
def _escape_attrib(text, encoding=None, replace=None):
122
127
    # escape attribute value
123
128
    try:
148
153
    }
149
154
def _escape_cdata_replace(match, map=escape_cdata_map):
150
155
    return map[match.group()]
151
 
 
 
156
 
152
157
def _escape_cdata(text, encoding=None, replace=None):
153
158
    # escape character data
154
159
    try: