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

  • Committer: Jelmer Vernooij
  • Date: 2019-12-23 01:39:21 UTC
  • mfrom: (7424 work)
  • mto: This revision was merged to the branch mainline in revision 7425.
  • Revision ID: jelmer@jelmer.uk-20191223013921-2kzd0wlcoylgxksk
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
378
378
 
379
379
 
380
380
def import_git_commit(repo, mapping, head, lookup_object,
381
 
                      target_git_object_retriever, trees_cache):
 
381
                      target_git_object_retriever, trees_cache, strict):
382
382
    o = lookup_object(head)
383
383
    # Note that this uses mapping.revision_id_foreign_to_bzr. If the parents
384
384
    # were bzr roundtripped revisions they would be specified in the
385
385
    # roundtrip data.
386
386
    rev, roundtrip_revid, verifiers = mapping.import_commit(
387
 
        o, mapping.revision_id_foreign_to_bzr)
 
387
        o, mapping.revision_id_foreign_to_bzr, strict)
388
388
    if roundtrip_revid is not None:
389
389
        original_revid = rev.revision_id
390
390
        rev.revision_id = roundtrip_revid
402
402
        base_tree = lookup_object(o.parents[0]).tree
403
403
        base_mode = stat.S_IFDIR
404
404
    store_updater = target_git_object_retriever._get_updater(rev)
405
 
    tree_supplement = mapping.get_fileid_map(lookup_object, o.tree)
406
405
    inv_delta, unusual_modes = import_git_tree(
407
406
        repo.texts, mapping, b"", b"", (base_tree, o.tree), base_bzr_tree,
408
407
        None, rev.revision_id, parent_trees, lookup_object,
409
408
        (base_mode, stat.S_IFDIR), store_updater,
410
 
        tree_supplement.lookup_file_id,
 
409
        mapping.generate_file_id,
411
410
        allow_submodules=repo._format.supports_tree_reference)
412
411
    if unusual_modes != {}:
413
412
        for path, mode in unusual_modes.iteritems():
483
482
            continue
484
483
        if isinstance(o, Commit):
485
484
            rev, roundtrip_revid, verifiers = mapping.import_commit(
486
 
                o, mapping.revision_id_foreign_to_bzr)
 
485
                o, mapping.revision_id_foreign_to_bzr, strict=True)
487
486
            if (repo.has_revision(rev.revision_id)
488
487
                    or (roundtrip_revid and
489
488
                        repo.has_revision(roundtrip_revid))):
516
515
                        pb.update("fetching revisions", offset + i,
517
516
                                  len(revision_ids))
518
517
                    import_git_commit(repo, mapping, head, lookup_object,
519
 
                                      target_git_object_retriever, trees_cache)
 
518
                                      target_git_object_retriever, trees_cache,
 
519
                                      strict=True)
520
520
                    last_imported = head
521
521
            except BaseException:
522
522
                repo.abort_write_group()