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
This commit is contained in:
Jun Wu 2020-07-30 20:24:12 -07:00 committed by Facebook GitHub Bot
parent bdf0655def
commit 64d4f5743f
4 changed files with 14 additions and 0 deletions

View File

@ -237,6 +237,11 @@ impl DagAlgorithm for commits {
let py = unsafe { Python::assume_gil_acquired() }; let py = unsafe { Python::assume_gil_acquired() };
self.inner(py).borrow().descendants(set) self.inner(py).borrow().descendants(set)
} }
fn reachable_roots(&self, roots: Set, heads: Set) -> Result<Set> {
let py = unsafe { Python::assume_gil_acquired() };
self.inner(py).borrow().reachable_roots(roots, heads)
}
} }
impl IdConvert for commits { impl IdConvert for commits {

View File

@ -223,6 +223,9 @@ impl DagAlgorithm for HgCommits {
fn descendants(&self, set: Set) -> Result<Set> { fn descendants(&self, set: Set) -> Result<Set> {
self.dag.descendants(set) self.dag.descendants(set)
} }
fn reachable_roots(&self, roots: Set, heads: Set) -> Result<Set> {
self.dag.reachable_roots(roots, heads)
}
} }
impl ToIdSet for HgCommits { impl ToIdSet for HgCommits {

View File

@ -174,6 +174,9 @@ impl DagAlgorithm for MemHgCommits {
fn descendants(&self, set: Set) -> Result<Set> { fn descendants(&self, set: Set) -> Result<Set> {
self.dag.descendants(set) self.dag.descendants(set)
} }
fn reachable_roots(&self, roots: Set, heads: Set) -> Result<Set> {
self.dag.reachable_roots(roots, heads)
}
} }
impl ToIdSet for MemHgCommits { impl ToIdSet for MemHgCommits {

View File

@ -163,6 +163,9 @@ impl DagAlgorithm for RevlogCommits {
fn descendants(&self, set: Set) -> Result<Set> { fn descendants(&self, set: Set) -> Result<Set> {
self.revlog.descendants(set) self.revlog.descendants(set)
} }
fn reachable_roots(&self, roots: Set, heads: Set) -> Result<Set> {
self.revlog.reachable_roots(roots, heads)
}
} }
impl ToIdSet for RevlogCommits { impl ToIdSet for RevlogCommits {