diff --git a/lib/src/default_index/composite.rs b/lib/src/default_index/composite.rs index 273313668a..d7a5c348ca 100644 --- a/lib/src/default_index/composite.rs +++ b/lib/src/default_index/composite.rs @@ -26,12 +26,13 @@ use super::entry::{ }; use super::readonly::ReadonlyIndexSegment; use super::rev_walk::RevWalk; +use super::revset_engine; use crate::backend::{ChangeId, CommitId}; +use crate::hex_util; use crate::index::Index; use crate::object_id::{HexPrefix, ObjectId, PrefixResolution}; use crate::revset::{ResolvedExpression, Revset, RevsetEvaluationError}; use crate::store::Store; -use crate::{default_revset_engine, hex_util}; pub(super) trait IndexSegment: Send + Sync { fn num_parent_commits(&self) -> u32; @@ -299,7 +300,7 @@ impl<'a> CompositeIndex<'a> { expression: &ResolvedExpression, store: &Arc, ) -> Result + 'a>, RevsetEvaluationError> { - let revset_impl = default_revset_engine::evaluate(expression, store, *self)?; + let revset_impl = revset_engine::evaluate(expression, store, *self)?; Ok(Box::new(revset_impl)) } } diff --git a/lib/src/default_index/mod.rs b/lib/src/default_index/mod.rs index 4b55283660..8cc0628232 100644 --- a/lib/src/default_index/mod.rs +++ b/lib/src/default_index/mod.rs @@ -19,6 +19,8 @@ mod entry; mod mutable; mod readonly; mod rev_walk; +pub mod revset_engine; +pub mod revset_graph_iterator; mod store; pub use self::composite::{AsCompositeIndex, CompositeIndex, IndexLevelStats, IndexStats}; diff --git a/lib/src/default_index/readonly.rs b/lib/src/default_index/readonly.rs index e0d8ae4f8f..ab8d015583 100644 --- a/lib/src/default_index/readonly.rs +++ b/lib/src/default_index/readonly.rs @@ -29,8 +29,8 @@ use thiserror::Error; use super::composite::{AsCompositeIndex, CompositeIndex, IndexSegment}; use super::entry::{IndexPosition, LocalPosition, SmallIndexPositionsVec}; use super::mutable::DefaultMutableIndex; +use super::revset_engine; use crate::backend::{ChangeId, CommitId}; -use crate::default_revset_engine; use crate::index::{Index, MutableIndex, ReadonlyIndex}; use crate::object_id::{HexPrefix, ObjectId, PrefixResolution}; use crate::revset::{ResolvedExpression, Revset, RevsetEvaluationError}; @@ -533,7 +533,7 @@ impl ReadonlyIndex for DefaultReadonlyIndex { expression: &ResolvedExpression, store: &Arc, ) -> Result>, RevsetEvaluationError> { - let revset_impl = default_revset_engine::evaluate(expression, store, self.clone())?; + let revset_impl = revset_engine::evaluate(expression, store, self.clone())?; Ok(Box::new(revset_impl)) } diff --git a/lib/src/default_revset_engine.rs b/lib/src/default_index/revset_engine.rs similarity index 99% rename from lib/src/default_revset_engine.rs rename to lib/src/default_index/revset_engine.rs index 8c69881e88..8e36189426 100644 --- a/lib/src/default_revset_engine.rs +++ b/lib/src/default_index/revset_engine.rs @@ -23,9 +23,9 @@ use std::sync::Arc; use itertools::Itertools; +use super::revset_graph_iterator::RevsetGraphIterator; use crate::backend::{ChangeId, CommitId, MillisSinceEpoch}; use crate::default_index::{AsCompositeIndex, CompositeIndex, IndexEntry, IndexPosition}; -use crate::default_revset_graph_iterator::RevsetGraphIterator; use crate::id_prefix::{IdIndex, IdIndexSource, IdIndexSourceEntry}; use crate::matchers::{EverythingMatcher, Matcher, PrefixMatcher, Visit}; use crate::object_id::{HexPrefix, PrefixResolution}; diff --git a/lib/src/default_revset_graph_iterator.rs b/lib/src/default_index/revset_graph_iterator.rs similarity index 100% rename from lib/src/default_revset_graph_iterator.rs rename to lib/src/default_index/revset_graph_iterator.rs diff --git a/lib/src/lib.rs b/lib/src/lib.rs index 1c896dbdaa..2340a3bb1a 100644 --- a/lib/src/lib.rs +++ b/lib/src/lib.rs @@ -27,8 +27,6 @@ pub mod commit_builder; pub mod conflicts; pub mod dag_walk; pub mod default_index; -pub mod default_revset_engine; -pub mod default_revset_graph_iterator; pub mod default_submodule_store; pub mod diff; pub mod file_util; diff --git a/lib/tests/test_default_revset_graph_iterator.rs b/lib/tests/test_default_revset_graph_iterator.rs index aac8c0abd9..738d1ad03c 100644 --- a/lib/tests/test_default_revset_graph_iterator.rs +++ b/lib/tests/test_default_revset_graph_iterator.rs @@ -14,8 +14,8 @@ use itertools::Itertools; use jj_lib::commit::Commit; +use jj_lib::default_index::revset_engine::{evaluate, RevsetImpl}; use jj_lib::default_index::DefaultReadonlyIndex; -use jj_lib::default_revset_engine::{evaluate, RevsetImpl}; use jj_lib::repo::{ReadonlyRepo, Repo as _}; use jj_lib::revset::ResolvedExpression; use jj_lib::revset_graph::RevsetGraphEdge;