Commit 33b9d751 authored by Pulkit Goyal's avatar Pulkit Goyal
Browse files

py3: use pycompat.ossep at certain places

Certain instances of os.sep has been converted to pycompat.ossep where it was
sure to use bytes only. There are more such instances which needs some more
attention and will get surely.
parent ad40d307a9f0
......@@ -61,6 +61,7 @@ from . import (
phases,
policy,
pvec,
pycompat,
repair,
revlog,
revset,
......@@ -3160,7 +3161,7 @@ def debugpathcomplete(ui, repo, *specs, **opts):
if os.path.isdir(spec):
spec += '/'
spec = spec[len(rootdir):]
fixpaths = os.sep != '/'
fixpaths = pycompat.ossep != '/'
if fixpaths:
spec = spec.replace(os.sep, '/')
speclen = len(spec)
......@@ -3755,7 +3756,7 @@ def debugwalk(ui, repo, *pats, **opts):
if not items:
return
f = lambda fn: fn
if ui.configbool('ui', 'slash') and os.sep != '/':
if ui.configbool('ui', 'slash') and pycompat.ossep != '/':
f = lambda fn: util.normpath(fn)
fmt = 'f %%-%ds %%-%ds %%s' % (
max([len(abs) for abs in items]),
......
......@@ -21,6 +21,7 @@ from . import (
osutil,
parsers,
pathutil,
pycompat,
scmutil,
util,
)
......@@ -215,7 +216,7 @@ class dirstate(object):
@propertycache
def _slash(self):
return self._ui.configbool('ui', 'slash') and os.sep != '/'
return self._ui.configbool('ui', 'slash') and pycompat.ossep != '/'
@propertycache
def _checklink(self):
......
......@@ -14,7 +14,11 @@ import socket
import stat as statmod
import sys
from . import policy
from . import (
policy,
pycompat,
)
modulepolicy = policy.policy
policynocffi = policy.policynocffi
......@@ -51,8 +55,8 @@ def listdirpure(path, stat=False, skip=None):
'''
result = []
prefix = path
if not prefix.endswith(os.sep):
prefix += os.sep
if not prefix.endswith(pycompat.ossep):
prefix += pycompat.ossep
names = os.listdir(path)
names.sort()
for fn in names:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment