~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to tools/history2weaves.py

  • Committer: Martin Pool
  • Date: 2005-09-19 10:25:50 UTC
  • Revision ID: mbp@sourcefrog.net-20050919102549-10d1dfddc367a97d
- conversion to weave tries to avoid repeated SHA calculation
- also set new inventory SHA into revision

Show diffs side-by-side

added added

removed removed

Lines of Context:
197
197
        new_inv_xml = serializer_v5.write_inventory_to_string(inv)
198
198
        inv_parents = [x for x in self.revisions[rev_id].parent_ids
199
199
                       if x not in self.absent_revisions]
 
200
        new_inv_sha1 = sha_string(new_inv_xml)
200
201
        self.inv_weave.add(rev_id, inv_parents,
201
 
                           new_inv_xml.splitlines(True))
 
202
                           new_inv_xml.splitlines(True),
 
203
                           new_inv_sha1)
202
204
        # TODO: Upgrade revision XML and write that out
 
205
        rev.inventory_sha1 = new_inv_sha1
203
206
        self.converted_revs.add(rev_id)
204
207
 
205
208
 
248
251
                if parent_ie.text_sha1 != ie.text_sha1:
249
252
                    text_changed = True
250
253
        if len(file_parents) != 1 or text_changed:
251
 
            w.add(rev_id, file_parents, file_lines)
 
254
            w.add(rev_id, file_parents, file_lines, ie.text_sha1)
252
255
            ie.name_version = ie.text_version = rev_id
253
256
            mutter('import text {%s} of {%s}',
254
257
                   ie.text_id, file_id)