diff -r 9f14126cfc4c -r 7c93e38a0bbd rust/hg-core/src/sparse.rs --- a/rust/hg-core/src/sparse.rs Tue Jul 19 17:07:09 2022 +0200 +++ b/rust/hg-core/src/sparse.rs Mon Jul 25 15:39:04 2022 +0200 @@ -54,14 +54,14 @@ #[derive(Debug, Default)] pub struct SparseConfig { // Line-separated - includes: Vec, + pub(crate) includes: Vec, // Line-separated - excludes: Vec, - profiles: HashSet>, - warnings: Vec, + pub(crate) excludes: Vec, + pub(crate) profiles: HashSet>, + pub(crate) warnings: Vec, } -/// All possible errors when reading sparse config +/// All possible errors when reading sparse/narrow config #[derive(Debug, derive_more::From)] pub enum SparseConfigError { IncludesAfterExcludes { @@ -71,6 +71,11 @@ context: SparseConfigContext, line: Vec, }, + /// Narrow config does not support '%include' directives + IncludesInNarrow, + /// An invalid pattern prefix was given to the narrow spec. Includes the + /// entire pattern for context. + InvalidNarrowPrefix(Vec), #[from] HgError(HgError), #[from] @@ -78,7 +83,7 @@ } /// Parse sparse config file content. -fn parse_config( +pub(crate) fn parse_config( raw: &[u8], context: SparseConfigContext, ) -> Result {