This is an archive of the discontinued Mercurial Phabricator instance.

rust: Parse system and user configuration
ClosedPublic

Authored by SimonSapin on Feb 5 2021, 4:26 AM.

Details

Summary

CLI --config argument parsing is still missing, as is per-repo config

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.Feb 5 2021, 4:26 AM
Alphare accepted this revision.Feb 8 2021, 9:21 AM
Alphare added a subscriber: Alphare.
Alphare added inline comments.
rust/hg-core/src/config/config.rs
133

typo 'platforms'

144

The order in config.txt is the same as the code, isn't it?

SimonSapin added inline comments.Feb 8 2021, 1:33 PM
rust/hg-core/src/config/config.rs
144

The code lists weakest precedence first (in Python because later config.set method calls overwrite previous values in a dict, in Rust because get_inner uses .rev() to find the last value for a given key). But config.txt lists strongest precedence first, starting with per-repository.

SimonSapin updated this revision to Diff 25498.Feb 8 2021, 2:00 PM
Alphare accepted this revision.Feb 9 2021, 3:39 AM
Alphare added inline comments.
rust/hg-core/src/config/config.rs
144

Maybe we should open a discussion or a bug about it. Right now, being compliant with the implementation seems like a safe bet.

pulkit accepted this revision.Feb 10 2021, 7:11 AM
This revision is now accepted and ready to land.Feb 10 2021, 7:11 AM
This revision was automatically updated to reflect the committed changes.