Option to disable Rust parts of Mercurial at run time
Using a Rust-enhanced Mercurial in Heptapod is certainly possible, we'd like to experiment with that soon. The ultra-fast persistent nodemap feature (depends on activation flag and repo preparation) is especially interesting for servers.
But the Rust endeavor in Mercurial is still considered experimental, so we need a way to disable it. Mercurial provides the
HGMODULEPOLICY environment variables, which should be easy to leverage in services.
But the Rails application and Heptapod Shell also spawn Mercurial processes directly. Therefore we need to add configuration flags to them so that they can set
A simple possibility would be:
mercurial: disable-rust: true
Rationale: if it were just
rust: false, it wouldn't be too obvious that
true actually means "use Rust parts if available" rather than any magical upgrade that doesn't exist.
Another option would be:
mercurial: module-policy: c
Rationale: This is lower level, but makes for better uniformity with the
HGMODULEPOLICY=c that will need to be set in the services. Also allows to use any policy (including thus any possible future one).
A third possibility would be to have the Rails app and Heptapod shell forward
HGMODULEPOLICY, so that it can be set in its service definition in the case of Rails and in the
sshd configuration in the case of Heptapod Shell. This is of course very uniform, but it's really tedious, both for source installations and for the exposition in Omnibus (necessary so that it survives Docker restarts, notably)