We have seen issues caused by user config file (~/.hgrc) having
unsupported extensions enabled. This new extension would allow us to warn
users about those problematic configs.
Details
- Reviewers
simonfar durham - Group Reviewers
Restricted Project - Commits
- rFBHGX1859b098b99e: configwarn: new extension to warn about unsupported configs
Diff Detail
- Repository
- rFBHGX Facebook Mercurial Extensions
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
cc @simonfar: I think this can help clean up legacy configs and unblocks us from simplifying the build process (aka comments on T20019093)
It looks like quite scary change. Maybe we can just prevent bad extensions from loading?
Back to you for a reply
hgext3rd/configrewrite.py | ||
---|---|---|
40 ↗ | (On Diff #344) | Please fail hard if the support contact is not set, with a suitable error - if we're going to do this, we *need* to make sure that people don't enable this without a decent support contact in place. |
59–72 ↗ | (On Diff #344) | I really don't like this - it feels like a route to trouble. I would prefer this module to:
Then we avoid all the fun with multi-line configs, commenting etc, and leave the fix in the user's hands, with an annoying warning every time they run hg until they fix their config. |
hgext3rd/configrewrite.py | ||
---|---|---|
59–72 ↗ | (On Diff #344) | We can do 2 (which is what this is doing if it cannot write a file). But 1 could be challenging since by the time our extension gets loaded, extensions.py has decided which extensions to load already. I'll revisit the code to see if there is a way (even hacky). |
hgext3rd/configwarn.py | ||
---|---|---|
52 | What about projectrc settings? If I understand the code here, a projectrc setting will not print the warning below. So maybe "systemconfigs" isn't quite the right name? |
hgext3rd/configwarn.py | ||
---|---|---|
52 | You're right. I thought it was rare that people change .hg/hgrc. Will add code to handle it. |
What about projectrc settings? If I understand the code here, a projectrc setting will not print the warning below. So maybe "systemconfigs" isn't quite the right name?