[Python-Dev] Mercurial migration: help needed

Dj Gilcrease digitalxero at gmail.com
Fri Aug 21 16:10:55 CEST 2009


On Fri, Aug 21, 2009 at 1:16 AM, Mark Hammond<skippy.hammond at gmail.com> wrote:
> Maybe you can enumerate what you think needs to change in mercurial, then
> once we have a plan in place it will be clearer who can do what.

The encode/decode hooks need to be passed the filename they are
working on so you can have an ignore list, this is why I consider my
method a hack since I am using a precommit hook to do conversion since
I am able to find out which file I am working on and make sure it is
not in an ignore list. There also needs to be a way to have required
and version controlled extensions.

This weekend I plan on digging into Mercurials hook code and doing up
a patch so the encode/decode hooks accept the filename they are
working on in a backwards compatible way

 > An alternative would be to go one level deeper and have:
 >
 > .hgrules/required/<extensionname>
 > .hgrules/optional/<extensionname>

I like this, though maybe .hgextensions since it would contain
versioned rules and the actual required extension. The extra sub
directories are not really required IMHO, you just have a hgrc file
that works the same as the local hgrc file except it only looks in the
.hgextensions directory for the correct extension so for python we
could have something like

[extensions]
format_enforcer =

[encode]
**=format_enforcer.cleverencode

[ignore]
*.sln=
...

[hooks]
pretxncommit.crlf = python:format_enforcer.forbidcrlf
pretxncommit.cr = python:format_enforcer.forbidcr


More information about the Python-Dev mailing list