comparison mercurial/dirstate.py @ 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 56b2bcea2529
children 3111b45a2bbf
comparison
equal deleted inserted replaced
26591:042344313939 26592:502b56a9e897
929 results[nf] = None 929 results[nf] = None
930 else: 930 else:
931 # We may not have walked the full directory tree above, 931 # We may not have walked the full directory tree above,
932 # so stat and check everything we missed. 932 # so stat and check everything we missed.
933 nf = iter(visit).next 933 nf = iter(visit).next
934 for st in util.statfiles([join(i) for i in visit]): 934 pos = 0
935 results[nf()] = st 935 while pos < len(visit):
936 # visit in mid-sized batches so that we don't
937 # block signals indefinitely
938 xr = xrange(pos, min(len(visit), pos + 1000))
939 for st in util.statfiles([join(visit[n]) for n in xr]):
940 results[nf()] = st
941 pos += 1000
936 return results 942 return results
937 943
938 def status(self, match, subrepos, ignored, clean, unknown): 944 def status(self, match, subrepos, ignored, clean, unknown):
939 '''Determine the status of the working copy relative to the 945 '''Determine the status of the working copy relative to the
940 dirstate and return a pair of (unsure, status), where status is of type 946 dirstate and return a pair of (unsure, status), where status is of type