diff --git a/lib/src/default_revset_engine.rs b/lib/src/default_revset_engine.rs index 2e9282bd7..bbacc0840 100644 --- a/lib/src/default_revset_engine.rs +++ b/lib/src/default_revset_engine.rs @@ -688,11 +688,9 @@ impl<'index, 'heads> EvaluationContext<'index, 'heads> { .revset_for_commit_ids(&self.composite_index.heads(&mut candidate_ids.iter()))) } RevsetExpression::Roots(candidates) => { - let connected_set = self.evaluate(&candidates.connected())?; - let filled: HashSet<_> = - connected_set.iter().map(|entry| entry.position()).collect(); - let mut index_entries = vec![]; let candidate_set = self.evaluate(candidates)?; + let (_, filled) = self.collect_dag_range(&*candidate_set, &*candidate_set); + let mut index_entries = vec![]; for candidate in candidate_set.iter() { if !candidate .parent_positions()