diff rust/hg-core/src/revlog/changelog.rs @ 51863:69b804c8e09e

rust: use new revlog configs in all revlog opening code This centralizes the more complex logic needed for the upcoming code and creates stronger APIs with fewer booleans. We also reuse `RevlogType` where needed.
author Rapha?l Gom?s <rgomes@octobus.net>
date Wed, 19 Jun 2024 12:49:26 +0200
parents bbe59cc5d2e1
children db7dbe6f7bb2
line wrap: on
line diff
--- a/rust/hg-core/src/revlog/changelog.rs	Tue Sep 17 10:18:32 2024 +0200
+++ b/rust/hg-core/src/revlog/changelog.rs	Wed Jun 19 12:49:26 2024 +0200
@@ -501,7 +501,10 @@
 mod tests {
     use super::*;
     use crate::vfs::Vfs;
-    use crate::NULL_REVISION;
+    use crate::{
+        RevlogDataConfig, RevlogDeltaConfig, RevlogFeatureConfig,
+        NULL_REVISION,
+    };
     use pretty_assertions::assert_eq;
 
     #[test]
@@ -562,9 +565,19 @@
         let temp = tempfile::tempdir().unwrap();
         let vfs = Vfs { base: temp.path() };
         std::fs::write(temp.path().join("foo.i"), b"").unwrap();
-        let revlog =
-            Revlog::open(&vfs, "foo.i", None, RevlogOpenOptions::new())
-                .unwrap();
+        std::fs::write(temp.path().join("foo.d"), b"").unwrap();
+        let revlog = Revlog::open(
+            &vfs,
+            "foo.i",
+            None,
+            RevlogOpenOptions::new(
+                false,
+                RevlogDataConfig::default(),
+                RevlogDeltaConfig::default(),
+                RevlogFeatureConfig::default(),
+            ),
+        )
+        .unwrap();
 
         let changelog = Changelog { revlog };
         assert_eq!(