I would like parent directories of projects to include an hgrc file that a repo in that folder inherits from, e.g.
~/work/
~/work/hgrc
~/work/project1/
~/work/project2/
~/personal/hgrc
~/personal/project1
~/personal/project2
~/personal/project3
Any project in work should inherit from work/hgrc, and any in personal should inherit from personal/hgrc. I was thinking of adding a script to ~/.hgrc that on clone would search for any hgrc files in parent directories and %include them if they exist, but this has the uglyness that if I add an hgrc below it after I clone it it won't be included. Only a 5% of the time consideration, but still...
How about putting:
%include ../hgrc
inside each repo's .hg/hgrc? You could even do that automatically but putting this in your systemwide /etc/mercurial/hgrc:
[hooks]
post-clone = echo '%include ../hgrc' >> .hg/hgrc
I've not tested that hook. :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With