# HG changeset patch # User Augie Fackler # Date 2014-06-23 13:33:07 # Node ID 73e4a02e6d23947e3affa47d204ff68ea7594ae5 # Parent 789b69d597cc1331dd7252c2e4c1e9f5a1009932 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. diff --git a/hg b/hg --- a/hg +++ b/hg @@ -10,6 +10,11 @@ import os import sys +if os.environ.get('HGUNICODEPEDANTRY', False): + reload(sys) + sys.setdefaultencoding("undefined") + + libdir = '@LIBDIR@' if libdir != '@' 'LIBDIR' '@':