Mercurial > hg-stable
changeset 26592:502b56a9e897
dirstate: batch calls to statfiles (issue4878)
This makes it more interruptible.
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Tue, 06 Oct 2015 16:26:20 -0500 |
parents | 042344313939 |
children | c60dfcc0abf2 |
files | mercurial/dirstate.py |
diffstat | 1 files changed, 8 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/dirstate.py Sun Oct 11 18:30:47 2015 +0900 +++ b/mercurial/dirstate.py Tue Oct 06 16:26:20 2015 -0500 @@ -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):