From 64d4f5743f178aa5d703c27b4bd26f233b073faf Mon Sep 17 00:00:00 2001 From: Jun Wu Date: Thu, 30 Jul 2020 20:24:12 -0700 Subject: [PATCH] dag: delegate reachable_root to inner implementations Summary: Otherwise the default implementation will be used. Reviewed By: sfilipco Differential Revision: D22657206 fbshipit-source-id: dea31149efe41cb3d9e30b33c138e437dce8011e --- eden/scm/edenscmnative/bindings/modules/pydag/src/commits.rs | 5 +++++ eden/scm/lib/hgcommits/src/hgsha1commits.rs | 3 +++ eden/scm/lib/hgcommits/src/memhgcommits.rs | 3 +++ eden/scm/lib/hgcommits/src/revlog.rs | 3 +++ 4 files changed, 14 insertions(+) diff --git a/eden/scm/edenscmnative/bindings/modules/pydag/src/commits.rs b/eden/scm/edenscmnative/bindings/modules/pydag/src/commits.rs index f07402b219..37a9c87263 100644 --- a/eden/scm/edenscmnative/bindings/modules/pydag/src/commits.rs +++ b/eden/scm/edenscmnative/bindings/modules/pydag/src/commits.rs @@ -237,6 +237,11 @@ impl DagAlgorithm for commits { let py = unsafe { Python::assume_gil_acquired() }; self.inner(py).borrow().descendants(set) } + + fn reachable_roots(&self, roots: Set, heads: Set) -> Result { + let py = unsafe { Python::assume_gil_acquired() }; + self.inner(py).borrow().reachable_roots(roots, heads) + } } impl IdConvert for commits { diff --git a/eden/scm/lib/hgcommits/src/hgsha1commits.rs b/eden/scm/lib/hgcommits/src/hgsha1commits.rs index b2d6d4639d..ef9f76e303 100644 --- a/eden/scm/lib/hgcommits/src/hgsha1commits.rs +++ b/eden/scm/lib/hgcommits/src/hgsha1commits.rs @@ -223,6 +223,9 @@ impl DagAlgorithm for HgCommits { fn descendants(&self, set: Set) -> Result { self.dag.descendants(set) } + fn reachable_roots(&self, roots: Set, heads: Set) -> Result { + self.dag.reachable_roots(roots, heads) + } } impl ToIdSet for HgCommits { diff --git a/eden/scm/lib/hgcommits/src/memhgcommits.rs b/eden/scm/lib/hgcommits/src/memhgcommits.rs index c7850cec0e..761e8dd00a 100644 --- a/eden/scm/lib/hgcommits/src/memhgcommits.rs +++ b/eden/scm/lib/hgcommits/src/memhgcommits.rs @@ -174,6 +174,9 @@ impl DagAlgorithm for MemHgCommits { fn descendants(&self, set: Set) -> Result { self.dag.descendants(set) } + fn reachable_roots(&self, roots: Set, heads: Set) -> Result { + self.dag.reachable_roots(roots, heads) + } } impl ToIdSet for MemHgCommits { diff --git a/eden/scm/lib/hgcommits/src/revlog.rs b/eden/scm/lib/hgcommits/src/revlog.rs index 22b47de27a..99ad379514 100644 --- a/eden/scm/lib/hgcommits/src/revlog.rs +++ b/eden/scm/lib/hgcommits/src/revlog.rs @@ -163,6 +163,9 @@ impl DagAlgorithm for RevlogCommits { fn descendants(&self, set: Set) -> Result { self.revlog.descendants(set) } + fn reachable_roots(&self, roots: Set, heads: Set) -> Result { + self.revlog.reachable_roots(roots, heads) + } } impl ToIdSet for RevlogCommits {