~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/xml7.py

(vila) Provide a config section matcher respecting the file order. (Vincent
 Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
    supported_kinds = set(['file', 'directory', 'symlink', 'tree-reference'])
31
31
    format_num = '7'
32
32
 
 
33
    def _unpack_entry(self, elt, entry_cache=None, return_from_cache=False):
 
34
        kind = elt.tag
 
35
        if not kind in self.supported_kinds:
 
36
            raise AssertionError('unsupported entry kind %s' % kind)
 
37
        if kind == 'tree-reference':
 
38
            file_id = elt.attrib['file_id']
 
39
            name = elt.attrib['name']
 
40
            parent_id = elt.attrib['parent_id']
 
41
            revision = elt.get('revision')
 
42
            reference_revision = elt.get('reference_revision')
 
43
            return inventory.TreeReference(file_id, name, parent_id, revision,
 
44
                                           reference_revision)
 
45
        else:
 
46
            return xml6.Serializer_v6._unpack_entry(self, elt,
 
47
                entry_cache=entry_cache, return_from_cache=return_from_cache)
33
48
 
34
49
serializer_v7 = Serializer_v7()