~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/xml5.py

Added more docs

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
        e.text = '\n'
36
36
        if inv.root.file_id not in (None, ROOT_ID):
37
37
            e.set('file_id', inv.root.file_id)
38
 
        if inv.revision_id is not None:
39
 
            e.set('revision_id', inv.revision_id)
40
38
        for path, ie in inv.iter_entries():
41
39
            e.append(self._pack_entry(ie))
42
40
        return e
44
42
 
45
43
    def _pack_entry(self, ie):
46
44
        """Convert InventoryEntry to XML element"""
47
 
        # TODO: should just be a plain assertion
48
45
        if not InventoryEntry.versionable_kind(ie.kind):
49
46
            raise AssertionError('unsupported entry kind %s' % ie.kind)
50
47
        e = Element(ie.kind)
124
121
            if format != '5':
125
122
                raise BzrError("invalid format version %r on inventory"
126
123
                                % format)
127
 
        revision_id = elt.get('revision_id')
128
 
        inv = Inventory(root_id, revision_id=revision_id)
 
124
        inv = Inventory(root_id)
129
125
        for e in elt:
130
126
            ie = self._unpack_entry(e)
131
127
            if ie.parent_id == ROOT_ID: