~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/revision.py

  • Committer: Martin Pool
  • Date: 2005-06-20 03:33:24 UTC
  • Revision ID: mbp@sourcefrog.net-20050620033324-77d683dbd54e8c7a
- when writing a revision, store the first parent as the precursor
  to support old readers

Show diffs side-by-side

added added

removed removed

Lines of Context:
119
119
                       )
120
120
        if self.timezone:
121
121
            root.set('timezone', str(self.timezone))
122
 
        if self.precursor:
123
 
            root.set('precursor', self.precursor)
124
 
            if self.precursor_sha1:
125
 
                root.set('precursor_sha1', self.precursor_sha1)
126
122
        root.text = '\n'
127
123
        
128
124
        msg = SubElement(root, 'message')
130
126
        msg.tail = '\n'
131
127
 
132
128
        if self.parents:
 
129
            # first parent stored as precursor for compatability with 0.0.5 and
 
130
            # earlier
 
131
            pr = self.parents[0]
 
132
            root.set('precursor', pr.revision_id)
 
133
            if pr.revision_sha1:
 
134
                root.set('precursor_sha1', pr.revision_sha1)
 
135
                
 
136
        if self.parents:
133
137
            pelts = SubElement(root, 'parents')
134
138
            pelts.tail = pelts.text = '\n'
135
139
            for rr in self.parents: