Proposal: (Allow to) Move the mercurial repository configuration files to a ".hgconfig" folder

Masklinn masklinn at masklinn.net
Mon May 31 13:03:03 UTC 2010


On 2010-05-31, at 14:51 , Harvey Chapman wrote:
> 
> 
> On May 31, 2010, at 6:50 AM, Yuya Nishihara wrote:
> 
>> See this thread:
>> http://thread.gmane.org/gmane.comp.version-control.mercurial.devel/27035/focus=27052
>> 
>> It can break many things to change the location of .hgxxx files.
> 
> So, don't change it, extend it.
> 
> From that thread:
>    Sounds like a gigantic headache. What happens if a user has .hgtags
>    files in both places?
> 
> Answer: "man hgrc", a file that can appear in many locations.
> 
> Why can't we encourage others to put their .hgconfig/.hgmeta files in a common subdir? Existing extensions could be modified to look there first and then fallback to the root of the working dir, otherwise.

Shouldn't hg provide a basic function handling that? Say, get_config(filename, mergeable=False) which would search the config paths [$REPO/.hgconfig, $REPO, $REPO/.hg, $HOME/.hgrc.d, $HOME] and in case the file is non-mergeable return the first one found, otherwise merge the files (ini-type?)? Or return a list of files found in the various repos/configs, and then the extension does whatever it wants with them, either merge them or just pop the first one and use it?

There would probably be some kind of trickiness to handle the dichotomy between dotted files and files in dotted dirs (so you'd have $REPO/.hgeol but $REPO/.hgconfig/hgeol), but that should be workable wouldn't it?


More information about the Mercurial mailing list