Fix util._statfiles_clustered() failing at root of a windows drive
authorPatrick Mezard <pmezard@gmail.com>
Sat, 01 Nov 2008 15:15:14 +0300
changeset 7301 00d76fa3ffba
parent 7300 591767e6ea7a
child 7302 972737252d05
Fix util._statfiles_clustered() failing at root of a windows drive Report and initial fix by Andrei Vermel <avermel@mail.ru>.
mercurial/osutil.py
mercurial/util.py
--- a/mercurial/osutil.py	Sat Nov 01 13:07:24 2008 +0100
+++ b/mercurial/osutil.py	Sat Nov 01 15:15:14 2008 +0300
@@ -26,7 +26,9 @@
       (name, type)
     '''
     result = []
-    prefix = path + os.sep
+    prefix = path
+    if not prefix.endswith(os.sep):
+        prefix += os.sep
     names = os.listdir(path)
     names.sort()
     for fn in names:
--- a/mercurial/util.py	Sat Nov 01 13:07:24 2008 +0100
+++ b/mercurial/util.py	Sat Nov 01 15:15:14 2008 +0300
@@ -856,7 +856,7 @@
         if pos == -1:
             dir, base = '.', nf
         else:
-            dir, base = nf[:pos], nf[pos+1:]
+            dir, base = nf[:pos+1], nf[pos+1:]
         cache = dircache.get(dir, None)
         if cache is None:
             try: