~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 04:57:46 UTC
  • Revision ID: mbp@sourcefrog.net-20050620045746-bbb1976f0af52b94
- correctly set parent list when committing first
  revision to a branch

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
 
 
128
121
        branch._write_inventory(work_inv)
129
122
 
130
123
        if timestamp == None:
144
137
                       inventory_id=inv_id,
145
138
                       inventory_sha1=inv_sha1,
146
139
                       revision_id=rev_id)
147
 
        rev.parents = [parent]
 
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)]
148
145
 
149
146
        rev_tmp = tempfile.TemporaryFile()
150
147
        rev.write_xml(rev_tmp)