rust/hg-cpython/src/dirstate/dirstate_map.rs
changeset 49120 3df46f3a3d6c
parent 49112 a55934393078
child 49121 10edc54d18f1
--- a/rust/hg-cpython/src/dirstate/dirstate_map.rs	Mon Mar 28 23:45:54 2022 +0200
+++ b/rust/hg-cpython/src/dirstate/dirstate_map.rs	Tue Mar 29 00:53:11 2022 +0200
@@ -489,6 +489,19 @@
         Ok(dirs)
     }
 
+    def setparents_fixup(&self) -> PyResult<PyDict> {
+        let dict = PyDict::new(py);
+        let copies = self.inner(py).borrow_mut().setparents_fixup();
+        for (key, value) in copies.map_err(|e| v2_error(py, e))? {
+            dict.set_item(
+                py,
+                PyBytes::new(py, key.as_bytes()),
+                PyBytes::new(py, value.as_bytes()),
+            )?;
+        }
+        Ok(dict)
+    }
+
     def debug_iter(&self, all: bool) -> PyResult<PyList> {
         let dirs = PyList::new(py, &[]);
         for item in self.inner(py).borrow().debug_iter(all) {