##// END OF EJS Templates
py3: replace os.sep with pycompat.ossep (part 3 of 4)
Pulkit Goyal -
r30615:bb77654d default
parent child Browse files
Show More
@@ -731,7 +731,7 b' def copy(ui, repo, pats, opts, rename=Fa'
731 731 else:
732 732 striplen = len(abspfx)
733 733 if striplen:
734 striplen += len(os.sep)
734 striplen += len(pycompat.ossep)
735 735 res = lambda p: os.path.join(dest, util.localpath(p)[striplen:])
736 736 elif destdirexists:
737 737 res = lambda p: os.path.join(dest,
@@ -765,12 +765,12 b' def copy(ui, repo, pats, opts, rename=Fa'
765 765 abspfx = util.localpath(abspfx)
766 766 striplen = len(abspfx)
767 767 if striplen:
768 striplen += len(os.sep)
768 striplen += len(pycompat.ossep)
769 769 if os.path.isdir(os.path.join(dest, os.path.split(abspfx)[1])):
770 770 score = evalpath(striplen)
771 771 striplen1 = len(os.path.split(abspfx)[0])
772 772 if striplen1:
773 striplen1 += len(os.sep)
773 striplen1 += len(pycompat.ossep)
774 774 if evalpath(striplen1) > score:
775 775 striplen = striplen1
776 776 res = lambda p: os.path.join(dest,
@@ -12,7 +12,10 b' import errno'
12 12 import mimetypes
13 13 import os
14 14
15 from .. import util
15 from .. import (
16 pycompat,
17 util,
18 )
16 19
17 20 httpserver = util.httpserver
18 21
@@ -139,7 +142,8 b' def staticfile(directory, fname, req):'
139 142 parts = fname.split('/')
140 143 for part in parts:
141 144 if (part in ('', os.curdir, os.pardir) or
142 os.sep in part or os.altsep is not None and os.altsep in part):
145 pycompat.ossep in part or
146 os.altsep is not None and os.altsep in part):
143 147 return
144 148 fpath = os.path.join(*parts)
145 149 if isinstance(directory, str):
@@ -31,6 +31,7 b' from . import ('
31 31 node,
32 32 pathutil,
33 33 phases,
34 pycompat,
34 35 scmutil,
35 36 util,
36 37 )
@@ -1172,7 +1173,7 b' class svnsubrepo(abstractsubrepo):'
1172 1173 changes.append(path)
1173 1174 for path in changes:
1174 1175 for ext in externals:
1175 if path == ext or path.startswith(ext + os.sep):
1176 if path == ext or path.startswith(ext + pycompat.ossep):
1176 1177 return True, True, bool(missing)
1177 1178 return bool(changes), False, bool(missing)
1178 1179
@@ -17,6 +17,7 b' from . import ('
17 17 error,
18 18 minirst,
19 19 parser,
20 pycompat,
20 21 registrar,
21 22 revset as revsetmod,
22 23 templatefilters,
@@ -1243,7 +1244,7 b' def stylemap(styles, paths=None):'
1243 1244 # only plain name is allowed to honor template paths
1244 1245 if (not style
1245 1246 or style in (os.curdir, os.pardir)
1246 or os.sep in style
1247 or pycompat.ossep in style
1247 1248 or os.altsep and os.altsep in style):
1248 1249 continue
1249 1250 locations = [os.path.join(style, 'map'), 'map-' + style]
@@ -215,7 +215,7 b' def setbinary(fd):'
215 215 msvcrt.setmode(fno(), os.O_BINARY)
216 216
217 217 def pconvert(path):
218 return path.replace(os.sep, '/')
218 return path.replace(pycompat.ossep, '/')
219 219
220 220 def localpath(path):
221 221 return path.replace('/', '\\')
@@ -316,7 +316,7 b' def findexe(command):'
316 316 return executable
317 317 return None
318 318
319 if os.sep in command:
319 if pycompat.ossep in command:
320 320 return findexisting(command)
321 321
322 322 for path in os.environ.get('PATH', '').split(pycompat.ospathsep):
General Comments 0
You need to be logged in to leave comments. Login now