Page MenuHomePhabricator

config: read configs from directories in lexicographical order
ClosedPublic

Authored by martinvonz on Apr 3 2019, 7:07 PM.

Details

Summary

Mercurial currently reads the .rc files specified in HGRCPATH (and the
system-default paths) in directory order, which is unspecified. My
team at work maintains a set of .rc files. So far there has been no
overlap between them, so we had not noticed this behavior. However, we
would now like to release some common .rc files and then have another
one per plaform with platform-specific overrides. It would be nice if
we can determine the load order by choosing names carefully. This
patch enables that by loading the .rc files in lexicographical order.

Before this patch, the added test case would consistently say "30" on
my file system (whatever I have -- some Linux FS).

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

martinvonz created this revision.Apr 3 2019, 7:07 PM
martinvonz updated this revision to Diff 14646.Apr 3 2019, 7:07 PM
martinvonz edited the summary of this revision. (Show Details)Apr 3 2019, 7:12 PM
This revision was automatically updated to reflect the committed changes.