~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/xml7.py

  • Committer: Vincent Ladeuil
  • Date: 2012-02-24 12:15:02 UTC
  • mto: (6437.23.15 2.5)
  • mto: This revision was merged to the branch mainline in revision 6475.
  • Revision ID: v.ladeuil+lp@free.fr-20120224121502-zd0v1gxfe4kvezm3
Open 2.5.1 for bugfixes

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()