diff options
-rw-r--r-- | revision_store.py | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/revision_store.py b/revision_store.py index a33c339..4ec4ba3 100644 --- a/revision_store.py +++ b/revision_store.py @@ -369,12 +369,13 @@ class AbstractRevisionStore(object): timezone=rev.timezone, committer=rev.committer, revprops=rev.properties, revision_id=rev.revision_id) if self._graph is None and self._use_known_graph: - if (getattr(_mod_graph, 'GraphThunkIdsToKeys', None) is None - or getattr(_mod_graph.KnownGraph, 'add_node', None) is None): - self._use_known_graph = False + if (getattr(_mod_graph, 'GraphThunkIdsToKeys', None) and + getattr(_mod_graph.GraphThunkIdsToKeys, "add_node", None) and + getattr(self.repo, "get_known_graph_ancestry", None)): + self._graph = self.repo.get_known_graph_ancestry( + rev.parent_ids) else: - self._graph = self.repo.revisions.get_known_graph_ancestry( - [(r,) for r in rev.parent_ids]) + self._use_known_graph = False if self._graph is not None: orig_heads = builder._heads def thunked_heads(file_id, revision_ids): @@ -384,8 +385,7 @@ class AbstractRevisionStore(object): if len(revision_ids) < 2: res = set(revision_ids) else: - res = set([h[0] for h in - self._graph.heads([(r,) for r in revision_ids])]) + res = set(self._graph.heads(revision_ids)) # if old_res != res: # import pdb; pdb.set_trace() return res @@ -416,12 +416,11 @@ class AbstractRevisionStore(object): builder.new_inventory, builder._config) if self._graph is not None: # TODO: Use StaticTuple and .intern() for these things - self._graph.add_node((builder._new_revision_id,), - [(p,) for p in rev.parent_ids]) + self._graph.add_node(builder._new_revision_id, rev.parent_ids) if signature is not None: raise AssertionError('signatures not guaranteed yet') - self.repo.add_signature_text(rev_id, signature) + self.repo.add_signature_text(rev.revision_id, signature) # self._add_revision(rev, inv) return builder.revision_tree().inventory |