Mercurial > public > mercurial-scm > hg
diff rust/hg-core/src/revlog/changelog.rs @ 52156:039b7caeb4d9
rust-revlog: introduce an `options` module
This helps group all the relevant revlog options code and makes the `mod.rs`
more readable.
author | Rapha?l Gom?s <rgomes@octobus.net> |
---|---|
date | Wed, 25 Sep 2024 18:24:15 +0200 |
parents | 1d6982827c4b |
children | e01e84e5e426 |
line wrap: on
line diff
--- a/rust/hg-core/src/revlog/changelog.rs Wed Sep 25 18:10:03 2024 +0200 +++ b/rust/hg-core/src/revlog/changelog.rs Wed Sep 25 18:24:15 2024 +0200 @@ -14,7 +14,9 @@ use crate::revlog::{Revlog, RevlogEntry, RevlogError}; use crate::utils::hg_path::HgPath; use crate::vfs::VfsImpl; -use crate::{Graph, GraphError, RevlogOpenOptions, UncheckedRevision}; +use crate::{Graph, GraphError, UncheckedRevision}; + +use super::options::RevlogOpenOptions; /// A specialized `Revlog` to work with changelog data format. pub struct Changelog { @@ -504,10 +506,7 @@ mod tests { use super::*; use crate::vfs::VfsImpl; - use crate::{ - RevlogDataConfig, RevlogDeltaConfig, RevlogFeatureConfig, - NULL_REVISION, - }; + use crate::NULL_REVISION; use pretty_assertions::assert_eq; #[test] @@ -571,18 +570,9 @@ }; std::fs::write(temp.path().join("foo.i"), b"").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 revlog = + Revlog::open(&vfs, "foo.i", None, RevlogOpenOptions::default()) + .unwrap(); let changelog = Changelog { revlog }; assert_eq!(