diff --git a/rust/hg-core/src/operations/debugdata.rs b/rust/hg-core/src/operations/debugdata.rs --- a/rust/hg-core/src/operations/debugdata.rs +++ b/rust/hg-core/src/operations/debugdata.rs @@ -29,7 +29,8 @@ let use_nodemap = repo .requirements() .contains(requirements::NODEMAP_REQUIREMENT); - let revlog = Revlog::open(repo, index_file, None, use_nodemap)?; + let revlog = + Revlog::open(&repo.store_vfs(), index_file, None, use_nodemap)?; let rev = crate::revset::resolve_rev_number_or_hex_prefix(revset, &revlog)?; let data = revlog.get_rev_data(rev)?; diff --git a/rust/hg-core/src/revlog/changelog.rs b/rust/hg-core/src/revlog/changelog.rs --- a/rust/hg-core/src/revlog/changelog.rs +++ b/rust/hg-core/src/revlog/changelog.rs @@ -21,7 +21,12 @@ let use_nodemap = repo .requirements() .contains(requirements::NODEMAP_REQUIREMENT); - let revlog = Revlog::open(repo, "00changelog.i", None, use_nodemap)?; + let revlog = Revlog::open( + &repo.store_vfs(), + "00changelog.i", + None, + use_nodemap, + )?; Ok(Self { revlog }) } diff --git a/rust/hg-core/src/revlog/filelog.rs b/rust/hg-core/src/revlog/filelog.rs --- a/rust/hg-core/src/revlog/filelog.rs +++ b/rust/hg-core/src/revlog/filelog.rs @@ -20,7 +20,12 @@ pub fn open(repo: &Repo, file_path: &HgPath) -> Result { let index_path = store_path(file_path, b".i"); let data_path = store_path(file_path, b".d"); - let revlog = Revlog::open(repo, index_path, Some(&data_path), false)?; + let revlog = Revlog::open( + &repo.store_vfs(), + index_path, + Some(&data_path), + false, + )?; Ok(Self { revlog }) } diff --git a/rust/hg-core/src/revlog/manifest.rs b/rust/hg-core/src/revlog/manifest.rs --- a/rust/hg-core/src/revlog/manifest.rs +++ b/rust/hg-core/src/revlog/manifest.rs @@ -19,7 +19,12 @@ let use_nodemap = repo .requirements() .contains(requirements::NODEMAP_REQUIREMENT); - let revlog = Revlog::open(repo, "00manifest.i", None, use_nodemap)?; + let revlog = Revlog::open( + &repo.store_vfs(), + "00manifest.i", + None, + use_nodemap, + )?; Ok(Self { revlog }) } diff --git a/rust/hg-core/src/revlog/revlog.rs b/rust/hg-core/src/revlog/revlog.rs --- a/rust/hg-core/src/revlog/revlog.rs +++ b/rust/hg-core/src/revlog/revlog.rs @@ -16,8 +16,8 @@ use super::nodemap_docket::NodeMapDocket; use super::patch; use crate::errors::HgError; -use crate::repo::Repo; use crate::revlog::Revision; +use crate::vfs::Vfs; use crate::{Node, NULL_REVISION}; const REVISION_FLAG_CENSORED: u16 = 1 << 15; @@ -81,14 +81,14 @@ /// interleaved. #[timed] pub fn open( - repo: &Repo, + store_vfs: &Vfs, index_path: impl AsRef, data_path: Option<&Path>, use_nodemap: bool, ) -> Result { let index_path = index_path.as_ref(); let index = { - match repo.store_vfs().mmap_open_opt(&index_path)? { + match store_vfs.mmap_open_opt(&index_path)? { None => Index::new(Box::new(vec![])), Some(index_mmap) => { let index = Index::new(Box::new(index_mmap))?; @@ -106,7 +106,7 @@ None } else { let data_path = data_path.unwrap_or(&default_data_path); - let data_mmap = repo.store_vfs().mmap_open(data_path)?; + let data_mmap = store_vfs.mmap_open(data_path)?; Some(Box::new(data_mmap)) }; @@ -115,7 +115,7 @@ } else if !use_nodemap { None } else { - NodeMapDocket::read_from_file(&repo.store_vfs(), index_path)?.map( + NodeMapDocket::read_from_file(store_vfs, index_path)?.map( |(docket, data)| { nodemap::NodeTree::load_bytes( Box::new(data),