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

Peter Arrenbrecht peter.arrenbrecht at gmail.com
Sun Jan 13 02:20:54 CST 2008


Jesse,

If rev0 should really prove to be potentially expensive to get, you
proposed caching it in .hg/identity or something. What do we do about
accesses to local repos where we don't have write permission? Just
live with the delay? Probe for write permission before attempting to
get rev0 - and if we cannot write, skip rev0 and checking @-sections
entirely?

And I guess we might want to disable this rev0 probing entirely if no
section in .hgrc has a @ in its name.


@mpm: Can you quickly tell us if the hash of rev0 (`hg id -r0`) is
cheap to get anyway, so we needn't worry? (Being cheap to get in
theory would suffice.)


-peo


On Jan 13, 2008 7:57 AM, Peter Arrenbrecht <peter.arrenbrecht at gmail.com> wrote:
> > I'm still sticking with my last proposal for now, except with a minor
> > syntax variant to make it simpler to document and read:
> > ...
> > [hooks at 9117c6561b0b]
> > incoming.build = make all
> > [defaults at 9117c6561b0b]
> > log = -M
>
> Neat. Much better syntax than before. Allows for easy copy/paste from
> .hg/hgrc to ~/.hgrc. Has no mulitple match and consequent include
> ordering problems.
>
> +1
>
> -peo
>
>
>
> On Jan 13, 2008 3:17 AM, Jesse Glick <jesse.glick at sun.com> wrote:
> > 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?
> >
> >
> > _______________________________________________
> > Mercurial-devel mailing list
> > Mercurial-devel at selenic.com
> > http://selenic.com/mailman/listinfo/mercurial-devel
> >
>


More information about the Mercurial-devel mailing list