/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

Don't import head revision twice when pulling from Git.

Show diffs side-by-side

added added

removed removed

Lines of Context:
362
362
    # TODO: a more (memory-)efficient implementation of this
363
363
    graph = []
364
364
    checked = set()
365
 
    heads = list(heads)
 
365
    heads = list(set(heads))
366
366
    parent_invs_cache = lru_cache.LRUSizeCache(compute_size=approx_inv_size,
367
367
                                               max_size=MAX_INV_CACHE_SIZE)
368
368
    # Find and convert commit objects
372
372
        head = heads.pop()
373
373
        assert isinstance(head, str)
374
374
        try:
375
 
            o = lookup_object(head)
 
375
            o = object_iter[head]
376
376
        except KeyError:
377
377
            trace.mutter('missing head %s', head)
378
378
            continue
386
386
                    (rev.revision_id, o.tree))
387
387
            heads.extend([p for p in o.parents if p not in checked])
388
388
        elif isinstance(o, Tag):
389
 
            heads.append(o.object[1])
 
389
            if o.object[1] not in checked:
 
390
                heads.append(o.object[1])
390
391
        else:
391
392
            trace.warning("Unable to import head object %r" % o)
392
393
        checked.add(o.id)