changeset 21812:73e4a02e6d23

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.
author Augie Fackler <raf@durin42.com>
date Mon, 23 Jun 2014 09:33:07 -0400
parents 789b69d597cc
children c2262004c2e2
files hg
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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' '@':