--- a/mercurial/util.py Wed Jan 09 21:30:13 2008 +0900
+++ b/mercurial/util.py Wed Jan 09 21:30:35 2008 +0900
@@ -341,7 +341,7 @@
"""return the canonical path of myname, given cwd and root"""
if root == os.sep:
rootsep = os.sep
- elif root.endswith(os.sep):
+ elif endswithsep(root):
rootsep = root
else:
rootsep = root + os.sep
@@ -882,6 +882,10 @@
"""return True if patches should be applied in binary mode by default."""
return os.name == 'nt'
+def endswithsep(path):
+ '''Check path ends with os.sep or os.altsep.'''
+ return path.endswith(os.sep) or os.altsep and path.endswith(os.altsep)
+
# Platform specific variants
if os.name == 'nt':
import msvcrt