[PATCH 7 of 8] py3: make scmutil.rcpath() return bytes

Pulkit Goyal 7895pulkit at gmail.com
Sat Nov 5 19:16:24 EDT 2016


# HG changeset patch
# User Pulkit Goyal <7895pulkit at gmail.com>
# Date 1478386039 -19800
#      Sun Nov 06 04:17:19 2016 +0530
# Node ID 6eed3ee0df425da61d03bfe024dd082f3176ce5d
# Parent  d9461776be8ccc38def14ef34c3337099fda9b23
py3: make scmutil.rcpath() return bytes

This patch make sure scmutil.rcpath() returns bytes independent of
which platform is used on Python 3. If we want to change type for windows we
can just conditionalize the return variable.

diff -r d9461776be8c -r 6eed3ee0df42 mercurial/scmutil.py
--- a/mercurial/scmutil.py	Sun Nov 06 04:10:33 2016 +0530
+++ b/mercurial/scmutil.py	Sun Nov 06 04:17:19 2016 +0530
@@ -27,6 +27,7 @@
     osutil,
     pathutil,
     phases,
+    pycompat,
     revset,
     similar,
     util,
@@ -755,7 +756,7 @@
     if _rcpath is None:
         if 'HGRCPATH' in encoding.environ:
             _rcpath = []
-            for p in os.environ['HGRCPATH'].split(os.pathsep):
+            for p in encoding.environ['HGRCPATH'].split(pycompat.ospathsep):
                 if not p:
                     continue
                 p = util.expandpath(p)


More information about the Mercurial-devel mailing list