--- a/rust/hg-core/src/requirements.rs Tue Oct 06 03:25:15 2020 +0200
+++ b/rust/hg-core/src/requirements.rs Tue Nov 24 18:52:38 2020 +0100
@@ -51,3 +51,22 @@
Err(error) => Err(RequirementsError::Io(error))?,
}
}
+
+pub fn check(repo_root: &Path) -> Result<(), RequirementsError> {
+ for feature in load(repo_root)? {
+ if !SUPPORTED.contains(&&*feature) {
+ return Err(RequirementsError::Unsupported { feature })
+ }
+ }
+ Ok(())
+}
+
+// TODO: set this to actually-supported features
+const SUPPORTED: &[&str] = &[
+ "dotencode",
+ "fncache",
+ "generaldelta",
+ "revlogv1",
+ "sparserevlog",
+ "store",
+];