osutil: make statfiles check for interrupts periodically
This is a simpler and faster fix for
issue4878 than the contortions
performed in
502b56a9e897.
--- a/mercurial/osutil.c Tue Nov 17 13:43:09 2015 -0800
+++ b/mercurial/osutil.c Tue Nov 17 13:47:14 2015 -0800
@@ -613,6 +613,11 @@
int ret, kind;
char *path;
+ /* With a large file count or on a slow filesystem,
+ don't block signals for long (issue4878). */
+ if ((i % 1000) == 999 && PyErr_CheckSignals() == -1)
+ goto bail;
+
pypath = PySequence_GetItem(names, i);
if (!pypath)
goto bail;