/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

mark remote git directories as not supporting working trees.

Show diffs side-by-side

added added

removed removed

Lines of Context:
344
344
def import_git_commit(repo, mapping, head, lookup_object,
345
345
                      target_git_object_retriever, trees_cache):
346
346
    o = lookup_object(head)
347
 
    rev, roundtrip_revid, verifiers = mapping.import_commit(o,
 
347
    rev, roundtrip_revid, testament3_sha1 = mapping.import_commit(o,
348
348
            lambda x: target_git_object_retriever.lookup_git_sha(x)[1][0])
349
349
    # We have to do this here, since we have to walk the tree and
350
350
    # we need to make sure to import the blobs / trees with the right
359
359
        base_tree = lookup_object(o.parents[0]).tree
360
360
        base_mode = stat.S_IFDIR
361
361
    store_updater = target_git_object_retriever._get_updater(rev)
 
362
    store_updater.add_object(o, None, None)
362
363
    fileid_map = mapping.get_fileid_map(lookup_object, o.tree)
363
364
    inv_delta, unusual_modes = import_git_tree(repo.texts,
364
365
            mapping, "", "", (base_tree, o.tree), base_inv,
366
367
            lookup_object, (base_mode, stat.S_IFDIR), store_updater,
367
368
            fileid_map.lookup_file_id,
368
369
            allow_submodules=getattr(repo._format, "supports_tree_reference", False))
 
370
    store_updater.finish()
369
371
    if unusual_modes != {}:
370
372
        for path, mode in unusual_modes.iteritems():
371
373
            warn_unusual_mode(rev.foreign_revid, path, mode)
377
379
        base_inv = None
378
380
    rev.inventory_sha1, inv = repo.add_inventory_by_delta(basis_id,
379
381
              inv_delta, rev.revision_id, rev.parent_ids, base_inv)
380
 
    # FIXME: Check verifiers
381
 
    testament = StrictTestament3(rev, inv)
382
 
    calculated_verifiers = { "testament3-sha1": testament.as_sha1() }
 
382
    # FIXME: Check testament3_sha1
383
383
    if roundtrip_revid is not None:
384
384
        original_revid = rev.revision_id
385
385
        rev.revision_id = roundtrip_revid
386
 
        if calculated_verifiers != verifiers:
 
386
        testament = StrictTestament3(rev, inv)
 
387
        if testament.as_sha1() != testament3_sha1:
387
388
            trace.mutter("Testament SHA1 %r for %r did not match %r.",
388
 
                         calculated_verifiers["testament3-sha1"],
389
 
                         rev.revision_id, verifiers["testament3-sha1"])
 
389
                         testament.as_sha1(), rev.revision_id, 
 
390
                         testament3_sha1)
390
391
            rev.revision_id = original_revid
391
 
    store_updater.add_object(o, calculated_verifiers, None)
392
 
    store_updater.finish()
393
392
    ret_tree = RevisionTree(repo, inv, rev.revision_id)
394
393
    trees_cache.add(ret_tree)
395
394
    repo.add_revision(rev.revision_id, rev)
428
427
        except KeyError:
429
428
            continue
430
429
        if isinstance(o, Commit):
431
 
            rev, roundtrip_revid, verifiers = mapping.import_commit(o,
 
430
            rev, roundtrip_revid, testament3_sha1 = mapping.import_commit(o,
432
431
                lambda x: None)
433
432
            if (repo.has_revision(rev.revision_id) or
434
433
                (roundtrip_revid and repo.has_revision(roundtrip_revid))):