/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 fetch.py

Fix `bzr-receive-pack` and `bzr-upload-pack`.

Show diffs side-by-side

added added

removed removed

Lines of Context:
275
275
        if stat.S_ISDIR(child_mode):
276
276
            subinvdelta, grandchildmodes = import_git_tree(texts, mapping,
277
277
                child_path, name, (child_base_hexsha, child_hexsha), base_inv,
278
 
                file_id, revision_id, parent_invs, lookup_object, 
 
278
                file_id, revision_id, parent_invs, lookup_object,
279
279
                (child_base_mode, child_mode), store_updater, lookup_file_id,
280
280
                allow_submodules=allow_submodules)
281
281
        elif S_ISGITLINK(child_mode): # submodule
305
305
 
306
306
 
307
307
def verify_commit_reconstruction(target_git_object_retriever, lookup_object,
308
 
    o, rev, ret_tree, parent_trees, mapping, unusual_modes):
 
308
    o, rev, ret_tree, parent_trees, mapping, unusual_modes, verifiers):
309
309
    new_unusual_modes = mapping.export_unusual_file_modes(rev)
310
310
    if new_unusual_modes != unusual_modes:
311
311
        raise AssertionError("unusual modes don't match: %r != %r" % (
312
312
            unusual_modes, new_unusual_modes))
313
313
    # Verify that we can reconstruct the commit properly
314
 
    rec_o = target_git_object_retriever._reconstruct_commit(rev, o.tree, True)
 
314
    rec_o = target_git_object_retriever._reconstruct_commit(rev, o.tree, True,
 
315
        verifiers)
315
316
    if rec_o != o:
316
317
        raise AssertionError("Reconstructed commit differs: %r != %r" % (
317
318
            rec_o, o))
377
378
        base_inv = None
378
379
    rev.inventory_sha1, inv = repo.add_inventory_by_delta(basis_id,
379
380
              inv_delta, rev.revision_id, rev.parent_ids, base_inv)
380
 
    # FIXME: Check verifiers
 
381
    # Check verifiers
381
382
    testament = StrictTestament3(rev, inv)
382
383
    calculated_verifiers = { "testament3-sha1": testament.as_sha1() }
383
384
    if roundtrip_revid is not None:
396
397
    if "verify" in debug.debug_flags:
397
398
        verify_commit_reconstruction(target_git_object_retriever, 
398
399
            lookup_object, o, rev, ret_tree, parent_trees, mapping,
399
 
            unusual_modes)
 
400
            unusual_modes, verifiers)
400
401
 
401
402
 
402
403
def import_git_objects(repo, mapping, object_iter,