diff rust/hg-core/src/repo.rs @ 48510:7f633432ca92

rhg: Sub-repositories are not supported Differential Revision: https://phab.mercurial-scm.org/D11940
author Simon Sapin <simon.sapin@octobus.net>
date Tue, 09 Nov 2021 18:17:52 +0100
parents 2097f63575a5
children 1d5fd9def5ac dd6b67d5c256
line wrap: on
line diff
--- a/rust/hg-core/src/repo.rs	Tue Dec 07 17:48:50 2021 -0800
+++ b/rust/hg-core/src/repo.rs	Tue Nov 09 18:17:52 2021 +0100
@@ -417,6 +417,14 @@
         )
     }
 
+    pub fn has_subrepos(&self) -> Result<bool, DirstateError> {
+        if let Some(entry) = self.dirstate_map()?.get(HgPath::new(".hgsub"))? {
+            Ok(entry.state().is_tracked())
+        } else {
+            Ok(false)
+        }
+    }
+
     pub fn filelog(&self, path: &HgPath) -> Result<Filelog, HgError> {
         Filelog::open(self, path)
     }