/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

Return mapping in revision_id_bzr_to_foreign() as required by the interface.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
from bzrlib.trace import info
22
22
from bzrlib.tsort import topo_sort
23
23
 
24
 
from bzrlib.plugins.git import git
25
24
from bzrlib.plugins.git.repository import (
26
25
        LocalGitRepository, 
27
26
        GitRepository, 
29
28
        )
30
29
from bzrlib.plugins.git.remote import RemoteGitRepository
31
30
 
 
31
import dulwich as git
32
32
from dulwich.client import SimpleFetchGraphWalker
33
33
from dulwich.objects import Commit
34
34
 
64
64
            self.heads.update([p for p in ps if not p in self.done])
65
65
            try:
66
66
                self.done.add(ret)
67
 
                return self.mapping.revision_id_bzr_to_foreign(ret)
 
67
                return self.mapping.revision_id_bzr_to_foreign(ret)[0]
68
68
            except InvalidRevisionId:
69
69
                pass
70
70
        return None
132
132
    """
133
133
    # TODO: a more (memory-)efficient implementation of this
134
134
    objects = {}
135
 
    for i, o in enumerate(object_iter):
 
135
    for i, (o, _) in enumerate(object_iter):
136
136
        if pb is not None:
137
137
            pb.update("fetching objects", i, num_objects) 
138
138
        objects[o.id] = o
209
209
            if revision_id is None:
210
210
                ret = heads.values()
211
211
            else:
212
 
                ret = [mapping.revision_id_bzr_to_foreign(revision_id)]
 
212
                ret = [mapping.revision_id_bzr_to_foreign(revision_id)[0]]
213
213
            return [rev for rev in ret if not self.target.has_revision(mapping.revision_id_foreign_to_bzr(rev))]
214
214
        graph_walker = BzrFetchGraphWalker(self.target, mapping)
215
215
        create_pb = None
264
264
        if revision_id is None:
265
265
            determine_wants = lambda x: [y for y in x.values() if not y in r.object_store]
266
266
        else:
267
 
            args = [mapping.revision_id_bzr_to_foreign(revision_id)]
 
267
            args = [mapping.revision_id_bzr_to_foreign(revision_id)[0]]
268
268
            determine_wants = lambda x: [y for y in args if not y in r.object_store]
269
269
 
270
270
        graphwalker = SimpleFetchGraphWalker(r.heads().values(), r.get_parents)