/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to object_store.py

Set and verify testament.

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
from bzrlib.revision import (
36
36
    NULL_REVISION,
37
37
    )
 
38
from bzrlib.testament import(
 
39
    StrictTestament3,
 
40
    )
38
41
 
39
42
from bzrlib.plugins.git.mapping import (
40
43
    default_mapping,
338
341
        self._update_sha_map()
339
342
        return iter(self._cache.idmap.sha1s())
340
343
 
341
 
    def _reconstruct_commit(self, rev, tree_sha, roundtrip):
 
344
    def _reconstruct_commit(self, rev, tree_sha, roundtrip, testament3_sha1):
342
345
        def parent_lookup(revid):
343
346
            try:
344
347
                return self._lookup_revision_sha1(revid)
345
348
            except errors.NoSuchRevision:
346
349
                return None
347
350
        return self.mapping.export_commit(rev, tree_sha, parent_lookup,
348
 
            roundtrip)
 
351
            roundtrip, testament3_sha1)
349
352
 
350
353
    def _create_fileid_map_blob(self, inv):
351
354
        # FIXME: This can probably be a lot more efficient, 
390
393
                root_tree[self.mapping.BZR_FILE_IDS_FILE] = ((stat.S_IFREG | 0644), b.id)
391
394
                yield self.mapping.BZR_FILE_IDS_FILE, b, None
392
395
        yield "", root_tree, root_ie
 
396
        if roundtrip:
 
397
            testament3 = StrictTestament3(rev, tree.inventory)
 
398
            testament3_sha1 = testament3.as_sha1()
 
399
        else:
 
400
            testament3_sha1 = None
393
401
        commit_obj = self._reconstruct_commit(rev, root_tree.id,
394
 
            roundtrip=roundtrip)
 
402
            roundtrip=roundtrip, testament3_sha1=testament3_sha1)
395
403
        try:
396
404
            foreign_revid, mapping = mapping_registry.parse_revision_id(
397
405
                rev.revision_id)