[PATCH] Check for .hgrc files in ancestor directories above the repository

Maxim Dounin mdounin at mdounin.ru
Thu Jan 10 20:45:04 CST 2008


Hello!

On Thu, Jan 10, 2008 at 07:59:46PM -0500, Jesse Glick wrote:

>Maxim Dounin wrote:
>> I think most flexible way to solve original problem is to add option
>> like:
>> 
>> hgrc = ../.hgrc
>> 
>> into ~/.hgrc
>
>Or to permit multiple such files to be checked, e.g.
>
>---%<--- ~/.hgrc
>[hgrc]
>../.hgrc =
>../../.hgrc =
>---%<---
>
>where paths would be resolved relative to repo root. This would not 
>permit configuration to be applied to arbitrarily nested trees in a 
>forest, but I think in practice most forests are likely shallow (i.e. 
>all trees are either root or direct children of root) so this would not 
>be too restrictive.
>
>I think logistically the [hgrc] section could only be defined in global 
>config files, not per-repo .hg/hgrc files (or recursively in included 
>hgrc's); otherwise it would be a bit of a mess since the included config 
>files must be read before .hg/hgrc.
>
>Alternate syntax suggestion:
>
>---%<--- ~/.hgrc
>[ui]
>includeconfig = ../.hgrc, ../../.hgrc
>---%<---
>
>If something like this sounds acceptable, I could make up a patch for it.

I'm not sure which syntax will be best (last one seems more 
natural for me, no sure how easy it can be implemented), but of 
course I mean it should have multiple values possible. We may also 
add some special value to mean 'ancestor directories'.

As I said before I'm even fine with your previous patch if this 
will be configurable and off by default (so user have to 
explicitly switch this on). I suggested the solution above just as 
one more flexible. 

Maxim Dounin


More information about the Mercurial-devel mailing list