Page MenuHomePhabricator

rust: Parse system and user configuration
ClosedPublic

Authored by SimonSapin on Fri, Feb 5, 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.Fri, Feb 5, 4:26 AM
Alphare accepted this revision.Mon, Feb 8, 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.Mon, Feb 8, 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.Mon, Feb 8, 2:00 PM
Alphare accepted this revision.Tue, Feb 9, 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.Wed, Feb 10, 7:11 AM
This revision is now accepted and ready to land.Wed, Feb 10, 7:11 AM
This revision was automatically updated to reflect the committed changes.