hg: add support for HGUNICODEPEDANTRY environment variable
authorAugie Fackler <raf@durin42.com>
Mon, 23 Jun 2014 09:33:07 -0400
changeset 21812 73e4a02e6d23
parent 21811 789b69d597cc
child 21813 c2262004c2e2
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.
hg
--- 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' '@':