diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
index 042344313939ab8b26821b0b60b5479ebd4b89de_bWVyY3VyaWFsL2RpcnN0YXRlLnB5..502b56a9e8973e0e19608bf360bc95372c6450cf_bWVyY3VyaWFsL2RpcnN0YXRlLnB5 100644
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -931,8 +931,14 @@
                 # We may not have walked the full directory tree above,
                 # so stat and check everything we missed.
                 nf = iter(visit).next
-                for st in util.statfiles([join(i) for i in visit]):
-                    results[nf()] = st
+                pos = 0
+                while pos < len(visit):
+                    # visit in mid-sized batches so that we don't
+                    # block signals indefinitely
+                    xr = xrange(pos, min(len(visit), pos + 1000))
+                    for st in util.statfiles([join(visit[n]) for n in xr]):
+                        results[nf()] = st
+                    pos += 1000
         return results
 
     def status(self, match, subrepos, ignored, clean, unknown):