diff rust/rhg/src/error.rs @ 49149:006688e36e12 stable

rhg: use `Command::exec` instead of `Command::status` `rhg` is supposed to be a transparent executable, using a subprocess defeats that purpose. See inline comments for more details. This also introduces the `which` crate to check if the fallback executable actually exists to help debugging (plain `execve` doesn't give much information). The error code 253 is used to signify that the fallback is not found, but may mean in the future that it is otherwise invalid if we start being more specific. Differential Revision: https://phab.mercurial-scm.org/D12578
author Raphaël Gomès <rgomes@octobus.net>
date Tue, 19 Apr 2022 12:27:40 +0200
parents ff97e793ed36
children 3f86ee422095
line wrap: on
line diff
--- a/rust/rhg/src/error.rs	Wed Apr 27 15:47:57 2022 +0200
+++ b/rust/rhg/src/error.rs	Tue Apr 19 12:27:40 2022 +0200
@@ -29,6 +29,9 @@
     /// `rhg` may attempt to silently fall back to Python-based `hg`, which
     /// may or may not support this feature.
     UnsupportedFeature { message: Vec<u8> },
+    /// The fallback executable does not exist (or has some other problem if
+    /// we end up being more precise about broken fallbacks).
+    InvalidFallback { path: Vec<u8>, err: String },
 }
 
 impl CommandError {