diff --git a/rust/hg-core/src/repo.rs b/rust/hg-core/src/repo.rs --- a/rust/hg-core/src/repo.rs +++ b/rust/hg-core/src/repo.rs @@ -246,6 +246,11 @@ self.requirements.contains(requirements::NARROW_REQUIREMENT) } + pub fn has_nodemap(&self) -> bool { + self.requirements + .contains(requirements::NODEMAP_REQUIREMENT) + } + fn dirstate_file_contents(&self) -> Result, HgError> { Ok(self .hg_vfs() @@ -345,10 +350,7 @@ } fn new_changelog(&self) -> Result { - let use_nodemap = self - .requirements - .contains(requirements::NODEMAP_REQUIREMENT); - Changelog::open(&self.store_vfs(), use_nodemap) + Changelog::open(&self.store_vfs(), self.has_nodemap()) } pub fn changelog(&self) -> Result, HgError> { @@ -360,10 +362,7 @@ } fn new_manifestlog(&self) -> Result { - let use_nodemap = self - .requirements - .contains(requirements::NODEMAP_REQUIREMENT); - Manifestlog::open(&self.store_vfs(), use_nodemap) + Manifestlog::open(&self.store_vfs(), self.has_nodemap()) } pub fn manifestlog(&self) -> Result, HgError> {