~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commit.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:
118
118
        # ever actually does anything special
119
119
        inv_sha1 = branch.get_inventory_sha1(inv_id)
120
120
 
 
121
        precursor_id = branch.last_patch()
 
122
        if precursor_id:
 
123
            precursor_sha1 = branch.get_revision_sha1(precursor_id)
 
124
        else:
 
125
            precursor_sha1 = None
 
126
        parent = RevisionReference(precursor_id, precursor_sha1)
 
127
 
121
128
        branch._write_inventory(work_inv)
122
129
 
123
130
        if timestamp == None:
137
144
                       inventory_id=inv_id,
138
145
                       inventory_sha1=inv_sha1,
139
146
                       revision_id=rev_id)
140
 
 
141
 
        precursor_id = branch.last_patch()
142
 
        if precursor_id:
143
 
            precursor_sha1 = branch.get_revision_sha1(precursor_id)
144
 
            rev.parents = [RevisionReference(precursor_id, precursor_sha1)]
 
147
        rev.parents = [parent]
145
148
 
146
149
        rev_tmp = tempfile.TemporaryFile()
147
150
        rev.write_xml(rev_tmp)