Mercurial > hg
comparison mercurial/dirstate.py @ 30614:cfe66dcf45c0
py3: replace os.sep with pycompat.ossep (part 2 of 4)
This part also replaces some chunks of os.sep with pycompat.ossep.
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Sat, 17 Dec 2016 20:02:50 +0530 |
parents | 20a42325fdef |
children | ad15646dc61c |
comparison
equal
deleted
inserted
replaced
30613:1112ff99d965 | 30614:cfe66dcf45c0 |
---|---|
284 if cwd == self._root: | 284 if cwd == self._root: |
285 return '' | 285 return '' |
286 # self._root ends with a path separator if self._root is '/' or 'C:\' | 286 # self._root ends with a path separator if self._root is '/' or 'C:\' |
287 rootsep = self._root | 287 rootsep = self._root |
288 if not util.endswithsep(rootsep): | 288 if not util.endswithsep(rootsep): |
289 rootsep += os.sep | 289 rootsep += pycompat.ossep |
290 if cwd.startswith(rootsep): | 290 if cwd.startswith(rootsep): |
291 return cwd[len(rootsep):] | 291 return cwd[len(rootsep):] |
292 else: | 292 else: |
293 # we're outside the repo. return an absolute path. | 293 # we're outside the repo. return an absolute path. |
294 return cwd | 294 return cwd |