##// END OF EJS Templates
py3: replace os.sep with pycompat.ossep (part 2 of 4)...
Pulkit Goyal -
r30614:cfe66dcf default
parent child Browse files
Show More
@@ -286,7 +286,7 b' class dirstate(object):'
286 286 # self._root ends with a path separator if self._root is '/' or 'C:\'
287 287 rootsep = self._root
288 288 if not util.endswithsep(rootsep):
289 rootsep += os.sep
289 rootsep += pycompat.ossep
290 290 if cwd.startswith(rootsep):
291 291 return cwd[len(rootsep):]
292 292 else:
@@ -9,6 +9,7 b' from .i18n import _'
9 9 from . import (
10 10 encoding,
11 11 error,
12 pycompat,
12 13 util,
13 14 )
14 15
@@ -87,8 +88,8 b' class pathauditor(object):'
87 88 # This means we won't accidentally traverse a symlink into some other
88 89 # filesystem (which is potentially expensive to access).
89 90 for i in range(len(parts)):
90 prefix = os.sep.join(parts[:i + 1])
91 normprefix = os.sep.join(normparts[:i + 1])
91 prefix = pycompat.ossep.join(parts[:i + 1])
92 normprefix = pycompat.ossep.join(normparts[:i + 1])
92 93 if normprefix in self.auditeddir:
93 94 continue
94 95 if self._realfs:
@@ -132,7 +133,7 b' def canonpath(root, cwd, myname, auditor'
132 133 if util.endswithsep(root):
133 134 rootsep = root
134 135 else:
135 rootsep = root + os.sep
136 rootsep = root + pycompat.ossep
136 137 name = myname
137 138 if not os.path.isabs(name):
138 139 name = os.path.join(root, cwd, name)
@@ -202,8 +203,8 b' def normasprefix(path):'
202 203 '/'
203 204 '''
204 205 d, p = os.path.splitdrive(path)
205 if len(p) != len(os.sep):
206 return path + os.sep
206 if len(p) != len(pycompat.ossep):
207 return path + pycompat.ossep
207 208 else:
208 209 return path
209 210
@@ -369,7 +369,7 b" if sys.platform == 'cygwin':"
369 369 # use upper-ing as normcase as same as NTFS workaround
370 370 def normcase(path):
371 371 pathlen = len(path)
372 if (pathlen == 0) or (path[0] != os.sep):
372 if (pathlen == 0) or (path[0] != pycompat.ossep):
373 373 # treat as relative
374 374 return encoding.upper(path)
375 375
@@ -381,7 +381,7 b" if sys.platform == 'cygwin':"
381 381 mplen = len(mp)
382 382 if mplen == pathlen: # mount point itself
383 383 return mp
384 if path[mplen] == os.sep:
384 if path[mplen] == pycompat.ossep:
385 385 return mp + encoding.upper(path[mplen:])
386 386
387 387 return encoding.upper(path)
@@ -456,7 +456,7 b' def findexe(command):'
456 456 return executable
457 457 return None
458 458
459 if os.sep in command:
459 if pycompat.ossep in command:
460 460 return findexisting(command)
461 461
462 462 if sys.platform == 'plan9':
General Comments 0
You need to be logged in to leave comments. Login now