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

Peter Arrenbrecht peter.arrenbrecht at gmail.com
Sat Jan 12 13:24:46 CST 2008


Hi Maxim, hi Jesse,

On Jan 12, 2008 3:31 PM, Maxim Dounin <mdounin at mdounin.ru> wrote:
>
> What about
>
> [include]
> ~/hg/ = ~/.hgrc-hg
> ~/mutt/ = ~/.hgrc-mutt
>
> syntax in config?
>
> The first one is directory prefix to match, the second is config
> to include if repo directory matches.
>
> Basically we get:
>
> 1. No security risks.
> 2. Flexibility.
> 3. Single config, so easy to debug.

I like this very much! How about combining it with Jesse's approach,
so we would have

~/.hgrc-203e82b1b502
~/.hgrc-9117c6561b0b

Then we would not even need any special configuration in ~/.hgrc. Just
add the above files to configure clones of particular 0-revisions.

Maxim's approach would make it unnecessary to get at rev 0's hash
efficiently (no need for, possibly, an additional cache in .hg). And I
guess it's easier to understand. How about using the already known
convention of glob/regex to specify custom .hgrc-xy files?

  [include]
  glob:~/dev/hg/** = ~/.hgrc-hg
  re:~/dev/netbeans/.* = ~/.hgrc-netbeans

with glob being the default? (Forgive me if the patterns are not quite correct.)

Jesse's idea, however, would transparently capture all clones of a
particular base rev, wherever they are located.

I like both, but I think Maxim's config approach is easier to grasp.
That's just my view, though.

-peo


More information about the Mercurial-devel mailing list