rust/hg-core/src/repo.rs
changeset 46601 755c31a1caf9
parent 46599 1f55cd5b292f
child 46613 f64b6953db70
--- a/rust/hg-core/src/repo.rs	Wed Feb 17 13:00:25 2021 +0100
+++ b/rust/hg-core/src/repo.rs	Tue Feb 16 13:08:37 2021 +0100
@@ -214,6 +214,15 @@
             base: &self.working_directory,
         }
     }
+
+    pub fn dirstate_parents(
+        &self,
+    ) -> Result<crate::dirstate::DirstateParents, HgError> {
+        let dirstate = self.hg_vfs().mmap_open("dirstate")?;
+        let parents =
+            crate::dirstate::parsers::parse_dirstate_parents(&dirstate)?;
+        Ok(parents.clone())
+    }
 }
 
 impl Vfs<'_> {