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

login
register
mail settings
Submitter Pulkit Goyal
Date Nov. 5, 2016, 11:16 p.m.
Message ID <6eed3ee0df425da61d03.1478387784@pulkit-goyal>
Download mbox | patch
Permalink /patch/17359/
State Accepted
Headers show

Comments

Pulkit Goyal - Nov. 5, 2016, 11:16 p.m.
# HG changeset patch
# User Pulkit Goyal <7895pulkit@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.

Patch

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)