hg: add support for HGUNICODEPEDANTRY environment variable
This lets us easily verify that there are no implicit conversions
between unicodes and bytes in Mercurial's codebase. Based on something
mpm did by hand periodically, but it kept regressing, so just open the
door to running it in a buildbot.
--- a/hg Tue May 27 21:02:16 2014 -0700
+++ b/hg Mon Jun 23 09:33:07 2014 -0400
@@ -10,6 +10,11 @@
import os
import sys
+if os.environ.get('HGUNICODEPEDANTRY', False):
+ reload(sys)
+ sys.setdefaultencoding("undefined")
+
+
libdir = '@LIBDIR@'
if libdir != '@' 'LIBDIR' '@':