Questions about contributing

Martin Geisler mg at aragost.com
Thu Sep 8 03:35:56 CDT 2011


Ben Hughes <ben at benrhughes.com> writes:

> 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.

I once talked with a bank -- difficult not to when you're based in
Zurich, Switzerland :-) -- and they loved the idea of Mercurial. They
had one question for me, though: can we rename ".hg" to "_hg". This was
for compatibility between some old mainframe systems and the Windows
filesystem interface to them. While there may be some work around, I can
see some use for such a feature.

> 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).

It's a little better than this since most access to files in the .hg
folder will go through the join method on a repository object. So most
of my grep hits hits are in documentation and the code should really do

  repo.join("foo")

to construct ".hg/foo" instead of os.path.join(repo.root, ".hg", "foo").

But there are still a number of places where ".hg" is referenced
explictly, such as the early dispatching that reads ".hg/hgrc".

Getting the value for ".hg" from an environment variable seems like the
best solution since it is a global setting for the entire program and a
setting that needs to kick in before config files are read.

-- 
Martin Geisler

aragost Trifork
Professional Mercurial support
http://mercurial.aragost.com/kick-start/


More information about the Mercurial-devel mailing list