[PATCH] RFC: localrepo: look at .hg/hgrc.d/*.rc after .hg/hgrc

Peter Arrenbrecht peter.arrenbrecht at gmail.com
Thu Mar 6 00:43:33 CST 2008


On Thu, Mar 6, 2008 at 12:51 AM, John Coomes <John.Coomes at sun.com> wrote:
>
> Bryan O'Sullivan (bos at serpentine.com) wrote:
>  > Peter Arrenbrecht wrote:
>  >
>  > > This is an attempt to solve the problem of configuring sets of
>  > > related server repos such that common config is kept central.
>  > > Instead of adding an include directive to .hg/hgrc, I simply
>  > > mimick /etc/mercurial/hgrc.d/*.rc for .hg/hgrc.d/*.rc. This allows
>  > > me to use symlinks to factor out common config:
>  >
>  > Nice idea.  Please polish it up and submit a real version.
>
>  The major goal mentioned on
>  http://www.selenic.com/mercurial/wiki/index.cgi/SpecificHgrcForSetsOfRepos
>  was to
>
>         Do this extra configuration in such a way that new clones are
>         automatically configured correctly.
>
>  I don't see how symlinks in .hg/hgrc.d/* accomplish it, since they're
>  not cloned (unless I'm missing something).

Absolutely correct. Sadly, we never got anywhere with that. And it was
focused on handling _client_ clones. I see there's a new proposal by
Jonathan Shapiro in this direction, which looks promising. But I
haven't looked at it in detail yet.

Meanwhile, I am trying to solve a problem on the _server_ right now.
At its most basic, this just allows me to factor out common config.
But you're right again, I do plan on my `hg rclone` extension
(controlled server-side clone) to clone some of the symlinks in
hgrc.d. I'll post that beast later when it's more polished.

A client-side clone extension that does something similar is, of
course, I tantalizing prospect, too. This would be the spirit of
Jesse's proposal to clone parts of .hgrc, but would in addition allow
such clones to remain symlinks to a central version. For example, we
could say .hg/hgrc.d/*-clonable.rc are cloned, others are not.

Anyhow, I think this change is nothing radically new (see
/etc/mercurial/hgrc.d/*.rc) and easy and safe to implement. And I'd
like to see _something_ that helps in this direction in hg 1.0.

> And what about filesystems
>  that don't have symlinks?

They lose. ;) But I'm thinking about *server* setups mainly here. And
as long as all common settings are factored out into a specific
.hgrc.d/common.rc, you could at least update them all consistently by
just replacing them with a new version. No need to parse and patch
.hgrc.

-peo


More information about the Mercurial-devel mailing list