mercurial/dirstate.py
changeset 7099 6f750e76fb46
parent 7096 6dab29f6df37
child 7118 619ebf82cef2
--- a/mercurial/dirstate.py	Wed Oct 15 14:06:46 2008 +0200
+++ b/mercurial/dirstate.py	Wed Oct 15 14:52:27 2008 +0200
@@ -492,11 +492,18 @@
             nd = work.pop()
             if hasattr(match, 'dir'):
                 match.dir(nd)
+            skip = None
             if nd == '.':
                 nd = ''
-                entries = listdir(join(nd), stat=True)
             else:
-                entries = listdir(join(nd), stat=True, skip ='.hg')
+                skip = '.hg'
+            try:
+                entries = listdir(join(nd), stat=True, skip=skip)
+            except OSError, inst:
+                if inst.errno == errno.EACCES:
+                    fwarn(nd, inst.strerror)
+                    continue
+                raise
             for f, kind, st in entries:
                 nf = normalize(nd and (nd + "/" + f) or f, True)
                 if nf not in results: