This is an archive of the discontinued Mercurial Phabricator instance.

rhg: Make fallback to Python the default behavior
AbandonedPublic

Authored by SimonSapin on Mar 3 2021, 12:08 PM.

Details

Reviewers
Alphare
Group Reviewers
hg-reviewers

Diff Detail

Repository
rHG Mercurial
Branch
default
Lint
No Linters Available
Unit
No Unit Test Coverage

Event Timeline

SimonSapin created this revision.Mar 3 2021, 12:08 PM
SimonSapin updated this revision to Diff 26050.Mar 4 2021, 6:10 AM
baymax updated this revision to Diff 26068.Mar 4 2021, 8:00 AM

✅ refresh by Heptapod after a successful CI run (🐙 💚)

Alphare accepted this revision.Mar 5 2021, 3:42 AM
SimonSapin updated this revision to Diff 26167.Mar 9 2021, 4:39 AM

Why do we want it the default behavior in general instead of the default behavior just during the test ?

My first though is that it seems safer to keep the explicit abort at this stage of the project. Whats your reasoning to flipping the switch now?

My reasoning is that we don’t want to push onto users the burden of keeping track of what functionality is supported natively by rhg or not, especially since we want that set to grow over time. Enabling fallback and using rhg as a drop-in replacement for hg that behaves the same (modulo speed and possible bugs) seems to me like the only scenario where rhg is really useful. The "abort with an error message" exists for tests where we want to assert that something is supported natively. The "abort silently" mode was initially designed to let a wrapper script implement fallback, but there’s no point "leaving that as an exercise to readers" if rhg can do it itself.

Just my two cents:

The "abort silently" mode was initially designed to let a wrapper script implement fallback, but there’s no point "leaving that as an exercise to readers" if rhg can do it itself.

Having a built-in fallback is good for ease of use, but we should also keep the external fallback with 252 exit code (not that you've ever said the contrary, just making sure).

Now that rhg is testable through (almost) the entire CI, I think we should encourage the default value to be something usable for users, I agree with Simon.

But as far as I understand, the default fallback value is the standard hg executable which is arbitrary and dangerous. For example if a user want to test the behavior of the new mercurial compares to the older one and directly call /some/path/rust/target/release/rhg, it will silently fall back to the system hg which is a pretty surprising behavior.

SimonSapin abandoned this revision.Mar 12 2021, 5:15 PM

Marmoute makes a good point about the default to looking up hg in $PATH being fragile, making it easy to accidentally use not the expected installation of Mercurial.

This is replaced by https://phab.mercurial-scm.org/D10187 and https://phab.mercurial-scm.org/D10189