[PATCH 1 of 6] mercurial: implement a source transforming module loader on Python 3

Jun Wu quark at fb.com
Mon Jun 6 16:45:57 EDT 2016


Right. I actually like this better than other solutions.

I mentioned the codec hack at the time I'm not aware of or fully understand
the module loader approach.

Excerpts from Gregory Szorc's message of 2016-06-06 12:29:25 -0700:
> I should probably add this to the commit message, but I chose this approach
> over a custom codec because it feels more robust and cleaner to me. With a
> custom codec:
> 
> * You need to declare the codec in the header of every .py file
> * When the transformation semantics change, we'd likely need to bump the
> codec name/version otherwise the cached .pyc will get used. This means
> updating every .py file whenever we change transformation logic. Yuck.


More information about the Mercurial-devel mailing list