This is an archive of the discontinued Mercurial Phabricator instance.

localrepo: extract loading of hgrc files to standalone function
ClosedPublic

Authored by indygreg on Nov 5 2018, 5:16 PM.

Details

Summary

Various 3rd party extensions supplement where per-repo config data
lives. Looking at their sources, they resort to unorthodox means to
inject the config data. And the way they do it is susceptible to
corner cases. e.g. not processing automatic extension loads,
not reacting to new or disabled extensions in configs, etc.

This commit extracts the core logic of loading hgrc files into
a standalone function so there is a clear function that can be
monkeypatched to inject per-repo config data at repository open
time.

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

indygreg created this revision.Nov 5 2018, 5:16 PM

LGTM.

As you looked at those extension that needed this feature, would it be useful to contact their authors and give them an opportunity to give their opinion on this series?

This revision was automatically updated to reflect the committed changes.