Browse Source

Actually use Repo.get_parents.

Jelmer Vernooij 11 years ago
parent
commit
7a597e6646
2 changed files with 3 additions and 11 deletions
  1. 0 8
      dulwich/object_store.py
  2. 3 3
      dulwich/repo.py

+ 0 - 8
dulwich/object_store.py

@@ -191,14 +191,6 @@ class BaseObjectStore(object):
             sha = graphwalker.next()
         return haves
 
-    def get_graph_walker(self, heads):
-        """Obtain a graph walker for this object store.
-
-        :param heads: Local heads to start search with
-        :return: GraphWalker object
-        """
-        return ObjectStoreGraphWalker(heads, lambda sha: self[sha].parents)
-
     def generate_pack_contents(self, have, want, progress=None):
         """Iterate over the contents of a pack file.
 

+ 3 - 3
dulwich/repo.py

@@ -215,8 +215,7 @@ class BaseRepo(object):
         """
         if heads is None:
             heads = self.refs.as_dict('refs/heads').values()
-        return ObjectStoreGraphWalker(
-            heads, lambda sha: self.object_store[sha].parents)
+        return ObjectStoreGraphWalker(heads, self.get_parents)
 
     def ref(self, name):
         """Return the SHA1 a ref is pointing to.
@@ -270,7 +269,8 @@ class BaseRepo(object):
         :param sha: SHA of the commit for which to retrieve the parents
         :return: List of parents
         """
-        return self.commit(sha).parents
+        # TODO: Lookup grafts as well
+        return self.object_store[sha].parents
 
     def get_config(self):
         """Retrieve the config object.