~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/xml5.py

  • Committer: Martin Pool
  • Date: 2005-09-19 07:52:30 UTC
  • Revision ID: mbp@sourcefrog.net-20050919075230-bd8a133ef1671044
- remove RevisionReference; just hold parent ids directly

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
from bzrlib.xml import ElementTree, SubElement, Element, Serializer
19
19
from bzrlib.inventory import ROOT_ID, Inventory, InventoryEntry
20
 
from bzrlib.revision import Revision, RevisionReference        
 
20
from bzrlib.revision import Revision        
21
21
from bzrlib.errors import BzrError
22
22
 
23
23
 
89
89
        if rev.parents:
90
90
            pelts = SubElement(root, 'parents')
91
91
            pelts.tail = pelts.text = '\n'
92
 
            for rr in rev.parents:
93
 
                assert isinstance(rr, RevisionReference)
 
92
            for parent_id in rev.parents:
 
93
                assert isinstance(parent_id, basestring)
94
94
                p = SubElement(pelts, 'revision_ref')
95
95
                p.tail = '\n'
96
 
                assert rr.revision_id
97
 
                p.set('revision_id', rr.revision_id)
98
 
 
 
96
                p.set('revision_id', parent_id)
99
97
        return root
100
98
 
101
99
    
149
147
        for p in parents:
150
148
            assert p.tag == 'revision_ref', \
151
149
                   "bad parent node tag %r" % p.tag
152
 
            rev_ref = RevisionReference(p.get('revision_id'))
153
 
            rev.parents.append(rev_ref)
 
150
            rev.parents.append(p.get('revision_id'))
154
151
 
155
152
        v = elt.get('timezone')
156
153
        rev.timezone = v and int(v)