Questions about contributing

Ben Hughes ben at
Wed Sep 7 23:22:24 CDT 2011

Hi all,
I'm looking to make some changes to Mercurial for a particular
use-case we have for my current project. I wanted to see if it's
something the community would interested in taking as a patch, and
also ask for some advice.

The change is to be able to control the name of the .hg directory. We
were hoping that '.hg' was set as a constant somewhere and that we
could simply change it and recompile. However it looks like it's just
an assumed convention and is used all over the place (in 65 .py files,
if my grep'ing is correct).

To give you a little bit of background, we're using Hg as a file
transport mechanism between multiple instances of our app. So far it's
been working flawlessly and gives us a lot of flexibility around
restoring files to previous states etc. In some cases we're
transporting source repositories of various types, including
Mercurial. Basically we want to be able to wrap the 'inner' .hg dir in
an enclosing .whatever dir.

We could achieve the same thing in a few different ways (messing about
with sub-repositories, renaming the inner .hg folder etc) but we'd
like to avoid writing repository-specific code if at all possible.

So my questions:
 - other than convention and convenience, is there any reason that the
.hg directory isn't currently stored in a constant somewhere?
 - is there a place where global constants should live?
 - if I were to make the change for our internal use (which is very
likely), is it a change that the community would be interested in?

The main downside I can think of is extensions that are hard-coded to
.hg, will break for anyone who uses a build with a different directory

I really appreciate any feedback and info you can give me.



PS - we switched to Hg for source control about a year ago and
continue to the thoroughly impressed by it. Thanks for all of your
awesome work.

More information about the Mercurial-devel mailing list