~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/xml5.py

  • Committer: Robert Collins
  • Date: 2005-10-03 05:54:35 UTC
  • mto: (1393.1.30)
  • mto: This revision was merged to the branch mainline in revision 1400.
  • Revision ID: robertc@robertcollins.net-20051003055434-c8ebd30d1de10247
move exporting functionality into inventory.py - uncovers bug in symlink support

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
 
46
46
    def _pack_entry(self, ie):
47
47
        """Convert InventoryEntry to XML element"""
48
 
        assert ie.kind in ('directory', 'file', 'symlink')
 
48
        if not InventoryEntry.versionable_kind(ie.kind):
 
49
            raise AssertionError('unsupported entry kind %s' % ie.kind)
49
50
        e = Element(ie.kind)
50
51
        e.set('name', ie.name)
51
52
        e.set('file_id', ie.file_id)
117
118
 
118
119
    def _unpack_entry(self, elt):
119
120
        kind = elt.tag
120
 
        if not kind in ('directory', 'file', 'symlink'):
 
121
        if not InventoryEntry.versionable_kind(kind):
121
122
            raise AssertionError('unsupported entry kind %s' % kind)
122
123
 
123
124
        parent_id = elt.get('parent_id')