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

Jesse Glick jesse.glick at sun.com
Sat Jan 12 20:17:51 CST 2008


Peter Arrenbrecht wrote:
> I'm happy now. Jesse?

My opinions:

1. 0-revision matches would do everything I want already. I have not 
heard of a use case to justify the added complexity of repository path 
matching.

2. Having configuration in ~/.hgrc which then points to additional 
configuration files seems unnecessarily confusing.

I'm still sticking with my last proposal for now, except with a minor 
syntax variant to make it simpler to document and read:

---%<---
To set default values for all clones of a repository, just suffix the 
section name with an '@' and the result of 'hg id -r0'.

For example: to hide merge commits and build immediately after pulls, 
but just for copies of Mercurial sources and not other projects, use

[hooks at 9117c6561b0b]
incoming.build = make all
[defaults at 9117c6561b0b]
log = -M
---%<---

No globs, no new files, no security issues that I can think of.

Searching for a file such as ~/.hgrc-9117c6561b0b (with normal-looking 
sections and key names) might be reasonable for Unix users, but I fear 
the naming scheme would not work as well on Windows, given both the 
custom of having a file extension such as '.ini' and the current lookup 
of an RC file path in the Registry for use by installers. (I don't 
really follow Maxim's fear of searching for config in more than one 
file, though; Hg already does this on Unix at least. Probably the 
showconfig command should anyway be enhanced to list which config files 
it reads, to make this more transparent.)

Anyone else care about this enough to comment?



More information about the Mercurial-devel mailing list