# HG changeset patch # User Raphaël Gomès # Date 2021-09-13 13:12:35 # Node ID ba773bd99203dd1ca1f549ce375d8cbfc2fed24b # Parent b44e1184b7e178ea34e2c9e71c6305d5e337ba7c rhg: fall back if subrepos are detected We do not handle subrepos yet, the addition of the support for `-r .` will break if we don't fall back. Differential Revision: https://phab.mercurial-scm.org/D11403 diff --git a/rust/rhg/src/main.rs b/rust/rhg/src/main.rs --- a/rust/rhg/src/main.rs +++ b/rust/rhg/src/main.rs @@ -98,6 +98,15 @@ fn main_with_result( config, repo, }; + + if let Ok(repo) = repo { + // We don't support subrepos, fallback if the subrepos file is present + if repo.working_directory_vfs().join(".hgsub").exists() { + let msg = "subrepos (.hgsub is present)"; + return Err(CommandError::unsupported(msg)); + } + } + let blackbox = blackbox::Blackbox::new(&invocation, process_start_time)?; blackbox.log_command_start(); let result = run(&invocation); diff --git a/tests/test-rhg.t b/tests/test-rhg.t --- a/tests/test-rhg.t +++ b/tests/test-rhg.t @@ -370,3 +370,12 @@ The blackbox extension is supported $ cat .hg/blackbox.log.1 ????/??/?? ??:??:??.??? * @d3873e73d99ef67873dac33fbcc66268d5d2b6f4 (*)> (rust) files (glob) +Subrepos are not supported + + $ touch .hgsub + $ $NO_FALLBACK rhg files + unsupported feature: subrepos (.hgsub is present) + [252] + $ rhg files + a + $ rm .hgsub