[PATCH] Check for .hgrc files in ancestor directories above the repository
Maxim Dounin
mdounin at mdounin.ru
Thu Jan 10 18:15:38 CST 2008
Hello!
On Thu, Jan 10, 2008 at 06:48:28PM -0500, Jesse Glick wrote:
[...]
>If this seems like a real issue to people, the files in ancestor
>directories could instead be called 'hgrc' (no dot), which would prevent
>possible conflicts with ~user/.hgrc, and ensure that ls (without -a)
>would make such files immediately visible. In such a case it would just
>be necessary to specifically exclude any **/.hg/hgrc - as could happen
>with repositories nested inside another repository's .hg directory, for
>example versioned MQ storage.
I'm quite happy with '.hgrc', just not happy with reading this
ancestor directories being default behaviour. Moving to 'hgrc'
instead will introduce additional issues with backuped .hg/hgrc
and global configuration files.
Actually, I think most flexible way to solve original problem is
to add option like:
hgrc = ../.hgrc
into ~/.hgrc, instructing hg to read configuration file relative
to repo root (or relative to .hg directory, keeping in mind the
default '.hg/hgrc'). With this we basically get:
1. User knows about what will happen, so no POLA violation.
2. Only some known places should be examined when debugging
configuration, no tree traversal by hand.
Maxim Dounin
More information about the Mercurial-devel
mailing list