Mercurial > public > mercurial-scm > hg-stable
diff mercurial/dirstate.py @ 5843:83c354c4d529
Add endswithsep() and use it instead of using os.sep and os.altsep directly.
This change is intended to allow hooking endswithsep() by win32mbcs
extension for MBCS support.
author | Shun-ichi GOTO <shunichi.goto@gmail.com> |
---|---|
date | Wed, 09 Jan 2008 21:30:35 +0900 |
parents | 111ed8c871bf |
children | d0576d065993 |
line wrap: on
line diff
--- a/mercurial/dirstate.py Wed Jan 09 21:30:13 2008 +0900 +++ b/mercurial/dirstate.py Wed Jan 09 21:30:35 2008 +0900 @@ -74,7 +74,7 @@ if cwd == self._root: return '' # self._root ends with a path separator if self._root is '/' or 'C:\' rootsep = self._root - if not rootsep.endswith(os.sep): + if not util.endswithsep(rootsep): rootsep += os.sep if cwd.startswith(rootsep): return cwd[len(rootsep):] @@ -410,7 +410,7 @@ # self._root may end with a path separator when self._root == '/' common_prefix_len = len(self._root) - if not self._root.endswith(os.sep): + if not util.endswithsep(self._root): common_prefix_len += 1 normpath = util.normpath