( )⚙ D10137 rhg: Fall back to Python if ui.relative-paths is configured

This is an archive of the discontinued Mercurial Phabricator instance.

rhg: Fall back to Python if ui.relative-paths is configured
ClosedPublic

Authored by SimonSapin on Mar 9 2021, 4:40 AM.

Details

Summary

This feature is not supported yet, and affects the output of some tests.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

SimonSapin created this revision.Mar 9 2021, 4:40 AM
baymax updated this revision to Diff 26196.Mar 9 2021, 8:40 AM

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

marmoute added inline comments.
rust/rhg/src/commands/files.rs
30–33

Note that "no" is not going to be enough since they are many way to express "false" for config boolean. Maybe reverse the logic and fallback for anything that is not the default config ?

Alphare added inline comments.
rust/rhg/src/commands/files.rs
30–33

You could use get_bool first?

SimonSapin added inline comments.Mar 11 2021, 4:49 AM
rust/rhg/src/commands/files.rs
30–33

This config is not quite a boolean since it also has a legacy value, where get_bool would return an error.

We could use .is_some() and fall back for any value other than the implicit default as I think marmoute suggested, which is more often than necessary. We could also implement the full parsing for this value, but then that leaves us dealing with legacy which resolves to either true or false depending on who’s asking.

marmoute added inline comments.Mar 12 2021, 11:51 AM
rust/rhg/src/commands/files.rs
30–33

I vote for doing the dummest correct things for now. And revisite this later.

SimonSapin retitled this revision from rhg: Fall back to Python if ui.relative-paths=no is configured to rhg: Fall back to Python if ui.relative-paths is configured.Mar 12 2021, 5:07 PM
SimonSapin edited the summary of this revision. (Show Details)
SimonSapin updated this revision to Diff 26297.
marmoute added inline comments.Mar 15 2021, 5:42 AM
rust/rhg/src/commands/files.rs
32

Is the error message still valid ?

baymax updated this revision to Diff 26343.Mar 15 2021, 9:10 AM

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

Alphare accepted this revision.Mar 16 2021, 4:52 AM
This revision was not accepted when it landed; it landed in state Needs Review.
This revision was automatically updated to reflect the committed changes.