Details
- Reviewers
Alphare pulkit - Group Reviewers
hg-reviewers - Commits
- rHGd7685105e504: rhg: Parse per-repository configuration
Diff Detail
- Repository
- rHG Mercurial
- Branch
- default
- Lint
No Linters Available - Unit
No Unit Test Coverage
Event Timeline
rust/hg-core/src/config/config.rs | ||
---|---|---|
29 | I'm not a big fan of adding a cache that can become potentially fragile for what I'm assuming to be so little performance gained. Maybe iterating in reverse through the layers until you hit one that is not from the CLI would be good enough? |
rust/hg-core/src/config/config.rs | ||
---|---|---|
29 | I was not at all thinking of this as a cache. Do you mean we could filter based on ConfigOrigin? I had not considered that but yeah it’s probably less fragile. Or, what do you think of having three Vecs instead of one? System+user, repo, and CLI layers kept separately. |
rust/hg-core/src/config/config.rs | ||
---|---|---|
29 | Currently, the ordering of layers gives us an easy answer to precedence that we lose if we split into multiple Vec. I say we keep it this way until we feel that this compromise is not worth it anymore and we need another abstraction layer. |
rust/hg-core/src/config/config.rs | ||
---|---|---|
29 | With three vecs the precedence logic would be centralized in a method that returns impl Iterator<Item=&ConfigLayer>. Which do you mean by keep it this way? With RangeFrom<usize>? |
rust/hg-core/src/config/config.rs | ||
---|---|---|
29 |
Right, while it's not particularly harder, I didn't feel like it was needed when adding the config logic. If you think that it'll be frequent enough to query the separate "groups" of layers then by all means, go ahead. :)
I meant using a single Vec. I am still -1 on using RangeFrom<usize>. |
rust/hg-core/src/config/config.rs | ||
---|---|---|
29 | It’s not frequent, combine_with_repo is the only thing that needs handle these hypothetically-separate vecs separately. And the separation would be purely to make the code simpler and less fragile. A single vec, do you by with combine_with_repo filtering based on ConfigOrigin? |
rust/hg-core/src/config/config.rs | ||
---|---|---|
29 | Yes, that's how I would do it. |
I'm not a big fan of adding a cache that can become potentially fragile for what I'm assuming to be so little performance gained. Maybe iterating in reverse through the layers until you hit one that is not from the CLI would be good enough?