/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 gitlib/git_repository.py

All tests are passing again

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
"""An adapter between a Git Repository and a Bazaar Branch"""
18
18
 
19
19
from bzrlib import (
 
20
    deprecated_graph,
20
21
    repository,
21
22
    urlutils,
22
23
    )
23
24
 
24
 
from bzrlib.plugins.git.gitlib import model
 
25
from bzrlib.plugins.git.gitlib import (
 
26
    ids,
 
27
    model,
 
28
    )
25
29
 
26
30
 
27
31
class GitRepository(repository.Repository):
53
57
        return self.get_revision_graph_with_ghosts(revisions).get_ancestors()
54
58
 
55
59
    def get_revision_graph_with_ghosts(self, revision_ids=None):
56
 
        result = deprecated_graph.Graph()
57
 
        for revision in self._ancestor_revisions(revision_ids):
58
 
            result.add_node(revision.revision_id, revision.parent_ids)
59
 
            self._revision_cache[revision.revision_id] = revision
 
60
        result = {}
 
61
        for node, parents in self._git.ancestry(None).iteritems():
 
62
            bzr_node = ids.convert_revision_id_git_to_bzr(node)
 
63
            bzr_parents = [ids.convert_revision_id_git_to_bzr(n)
 
64
                           for n in parents]
 
65
            result[bzr_node] = bzr_parents
60
66
        return result
61
67
 
62
68
    def get_revision(self, revision_id):