rust/hg-pyo3/src/dirstate/dirstate_map.rs
changeset 52865 6b38ff460f2a
parent 52864 d961e09d3d8c
child 52866 c917656a259d
--- a/rust/hg-pyo3/src/dirstate/dirstate_map.rs	Thu Jan 30 12:24:41 2025 +0100
+++ b/rust/hg-pyo3/src/dirstate/dirstate_map.rs	Tue Feb 04 10:42:26 2025 +0100
@@ -32,7 +32,7 @@
     DirstateParents,
 };
 
-use super::item::DirstateItem;
+use super::{copy_map::CopyMap, item::DirstateItem};
 use crate::{
     exceptions::{
         dirstate_error, dirstate_v2_error, map_try_lock_error,
@@ -383,6 +383,10 @@
         Self::keys(slf)
     }
 
+    fn copymap(slf: &Bound<'_, Self>) -> PyResult<Py<CopyMap>> {
+        CopyMap::new(slf).and_then(|cm| Py::new(slf.py(), cm))
+    }
+
     fn tracked_dirs(
         slf: &Bound<'_, Self>,
         py: Python,
@@ -478,7 +482,7 @@
         Ok(Some((PyHgPathRef(key), py_entry).into_pyobject(py)?.into()))
     }
 
-    pub fn with_inner_read<'py, T>(
+    pub(super) fn with_inner_read<'py, T>(
         slf: &Bound<'py, Self>,
         f: impl FnOnce(
             &PyRef<'py, Self>,
@@ -493,7 +497,7 @@
         f(&self_ref, guard)
     }
 
-    fn with_inner_write<'py, T>(
+    pub(super) fn with_inner_write<'py, T>(
         slf: &Bound<'py, Self>,
         f: impl FnOnce(
             &PyRef<'py, Self>,