/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

  • Committer: Jelmer Vernooij
  • Date: 2010-04-30 23:03:01 UTC
  • mto: (0.200.912 trunk)
  • mto: This revision was merged to the branch mainline in revision 6960.
  • Revision ID: jelmer@samba.org-20100430230301-w4xncjn5svh2ghl4
Support storing revision id data.

Show diffs side-by-side

added added

removed removed

Lines of Context:
317
317
def import_git_commit(repo, mapping, head, lookup_object,
318
318
                      target_git_object_retriever, trees_cache):
319
319
    o = lookup_object(head)
320
 
    rev = mapping.import_commit(o)
 
320
    rev, file_ids = mapping.import_commit(o)
321
321
    # We have to do this here, since we have to walk the tree and
322
322
    # we need to make sure to import the blobs / trees with the right
323
323
    # path; this may involve adding them more than once.
332
332
        base_mode = stat.S_IFDIR
333
333
    store_updater = target_git_object_retriever._get_updater(rev)
334
334
    store_updater.add_object(o, None)
 
335
    def lookup_file_id(path):
 
336
        try:
 
337
            return file_ids[path]
 
338
        except KeyError:
 
339
            return mapping.generate_file_id(path)
335
340
    inv_delta, unusual_modes = import_git_tree(repo.texts,
336
341
            mapping, "", u"", (base_tree, o.tree), base_inv, 
337
342
            None, rev.revision_id, [p.inventory for p in parent_trees],
338
343
            lookup_object, (base_mode, stat.S_IFDIR), store_updater,
339
 
            mapping.generate_file_id,
 
344
            lookup_file_id,
340
345
            allow_submodules=getattr(repo._format, "supports_tree_reference", False))
341
346
    store_updater.finish()
342
347
    if unusual_modes != {}:
389
394
        except KeyError:
390
395
            continue
391
396
        if isinstance(o, Commit):
392
 
            rev = mapping.import_commit(o)
 
397
            rev, file_ids = mapping.import_commit(o)
393
398
            if repo.has_revision(rev.revision_id):
394
399
                continue
395
400
            squash_revision(repo, rev)