rust/hg-core/src/repo.rs
changeset 49090 a5ef50becea8
parent 49005 12adf8c695ed
child 49091 9b5334c1e499
--- a/rust/hg-core/src/repo.rs	Tue Apr 12 21:25:56 2022 -0700
+++ b/rust/hg-core/src/repo.rs	Fri Apr 15 09:37:13 2022 -0700
@@ -187,8 +187,8 @@
                 Self::read_dirstate_data_file_uuid,
             ),
             dirstate_map: LazyCell::new(Self::new_dirstate_map),
-            changelog: LazyCell::new(Changelog::open),
-            manifestlog: LazyCell::new(Manifestlog::open),
+            changelog: LazyCell::new(Self::new_changelog),
+            manifestlog: LazyCell::new(Self::new_manifestlog),
         };
 
         requirements::check(&repo)?;
@@ -344,6 +344,13 @@
         self.dirstate_map.get_mut_or_init(self)
     }
 
+    fn new_changelog(&self) -> Result<Changelog, HgError> {
+        let use_nodemap = self
+            .requirements
+            .contains(requirements::NODEMAP_REQUIREMENT);
+        Changelog::open(&self.store_vfs(), use_nodemap)
+    }
+
     pub fn changelog(&self) -> Result<Ref<Changelog>, HgError> {
         self.changelog.get_or_init(self)
     }
@@ -352,6 +359,13 @@
         self.changelog.get_mut_or_init(self)
     }
 
+    fn new_manifestlog(&self) -> Result<Manifestlog, HgError> {
+        let use_nodemap = self
+            .requirements
+            .contains(requirements::NODEMAP_REQUIREMENT);
+        Manifestlog::open(&self.store_vfs(), use_nodemap)
+    }
+
     pub fn manifestlog(&self) -> Result<Ref<Manifestlog>, HgError> {
         self.manifestlog.get_or_init(self)
     }