1
from bzrlib import cache_utf8, inventory, errors, xml5
4
class Serializer_v6(xml5.Serializer_v5):
6
def _append_inventory_root(self, append, inv):
7
"""Append the inventory root to output."""
10
append(' revision_id="')
11
append(xml5._encode_and_escape(inv.revision_id))
13
self._append_entry(append, inv.root)
15
def _parent_condition(self, ie):
16
return ie.parent_id is not None
18
def _unpack_inventory(self, elt):
19
"""Construct from XML Element"""
20
assert elt.tag == 'inventory'
21
format = elt.get('format')
22
if format is not None:
24
raise errors.BzrError("invalid format version %r on inventory"
26
revision_id = elt.get('revision_id')
27
if revision_id is not None:
28
revision_id = cache_utf8.get_cached_unicode(revision_id)
29
inv = inventory.Inventory(root_id=None, revision_id=revision_id)
31
ie = self._unpack_entry(e, none_parents=True)
36
serializer_v6 = Serializer_v6()