~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/xml7.py

  • Committer: Jelmer Vernooij
  • Date: 2012-04-16 11:08:11 UTC
  • mfrom: (6521 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6522.
  • Revision ID: jelmer@samba.org-20120416110811-0y996ihqy9o2bb1t
Merge bzr.dev.

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)
48
33
 
49
34
serializer_v7 = Serializer_v7()