~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/xml5.py

  • Committer: Robert Collins
  • Date: 2005-10-18 05:26:22 UTC
  • mto: This revision was merged to the branch mainline in revision 1463.
  • Revision ID: robertc@robertcollins.net-20051018052622-653d638c9e26fde4
fix broken tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /usr/bin/env python
 
2
 
1
3
# This program is free software; you can redistribute it and/or modify
2
4
# it under the terms of the GNU General Public License as published by
3
5
# the Free Software Foundation; either version 2 of the License, or
13
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
14
16
 
15
17
 
16
 
from bzrlib.xml_serializer import ElementTree, SubElement, Element, Serializer
 
18
from bzrlib.xml import ElementTree, SubElement, Element, Serializer
17
19
from bzrlib.inventory import ROOT_ID, Inventory, InventoryEntry
18
20
import bzrlib.inventory as inventory
19
21
from bzrlib.revision import Revision        
35
37
        e.text = '\n'
36
38
        if inv.root.file_id not in (None, ROOT_ID):
37
39
            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
40
        for path, ie in inv.iter_entries():
41
41
            e.append(self._pack_entry(ie))
42
42
        return e
123
123
            if format != '5':
124
124
                raise BzrError("invalid format version %r on inventory"
125
125
                                % format)
126
 
        revision_id = elt.get('revision_id')
127
 
        inv = Inventory(root_id, revision_id=revision_id)
 
126
        inv = Inventory(root_id)
128
127
        for e in elt:
129
128
            ie = self._unpack_entry(e)
130
129
            if ie.parent_id == ROOT_ID: