mercurial/osutil.py
changeset 7034 0d513661d6c2
parent 5396 5105b119edd2
child 7057 094af6eeb7d7
--- a/mercurial/osutil.py	Sat Sep 13 10:44:44 2008 -0500
+++ b/mercurial/osutil.py	Sat Sep 13 10:46:47 2008 -0500
@@ -10,7 +10,7 @@
     if stat.S_ISSOCK(mode): return stat.S_IFSOCK
     return mode
 
-def listdir(path, stat=False):
+def listdir(path, stat=False, skip=None):
     '''listdir(path, stat=False) -> list_of_tuples
 
     Return a sorted list containing information about the entries
@@ -30,6 +30,8 @@
     names.sort()
     for fn in names:
         st = os.lstat(prefix + fn)
+        if fn == skip and stat.S_ISDIR(st.st_mode):
+            return []
         if stat:
             result.append((fn, _mode_to_kind(st.st_mode), st))
         else: