changeset 5845:5924a11aa419

Fix not to use os.sep directly. This change is intended for MBCS support.
author Shun-ichi GOTO <shunichi.goto@gmail.com>
date Wed, 09 Jan 2008 21:30:37 +0900
parents 07d8eb78dd68
children 02884e56c217
files mercurial/util.py
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/util.py	Wed Jan 09 21:30:36 2008 +0900
+++ b/mercurial/util.py	Wed Jan 09 21:30:37 2008 +0900
@@ -713,14 +713,15 @@
                       os.path.isdir(os.path.join(curpath, '.hg'))):
                     raise Abort(_('path %r is inside repo %r') %
                                 (path, prefix))
-
+        parts.pop()
         prefixes = []
-        for c in strutil.rfindall(normpath, os.sep):
-            prefix = normpath[:c]
+        for n in range(len(parts)):
+            prefix = os.sep.join(parts)
             if prefix in self.auditeddir:
                 break
             check(prefix)
             prefixes.append(prefix)
+            parts.pop()
 
         self.audited.add(path)
         # only add prefixes to the cache after checking everything: we don't