mercurial/cmdutil.py
changeset 18710 49ef9d0ca815
parent 18688 79107fad06aa
child 18852 300844cb1a56
equal deleted inserted replaced
18709:9955fc5ee24b 18710:49ef9d0ca815
  1208         stop = min(revs[0], revs[-1])
  1208         stop = min(revs[0], revs[-1])
  1209         for x in xrange(rev, stop - 1, -1):
  1209         for x in xrange(rev, stop - 1, -1):
  1210             if ff.match(x):
  1210             if ff.match(x):
  1211                 wanted.discard(x)
  1211                 wanted.discard(x)
  1212 
  1212 
       
  1213     # Choose a small initial window if we will probably only visit a
       
  1214     # few commits.
       
  1215     limit = loglimit(opts)
       
  1216     windowsize = 8
       
  1217     if limit:
       
  1218         windowsize = min(limit, windowsize)
       
  1219 
  1213     # Now that wanted is correctly initialized, we can iterate over the
  1220     # Now that wanted is correctly initialized, we can iterate over the
  1214     # revision range, yielding only revisions in wanted.
  1221     # revision range, yielding only revisions in wanted.
  1215     def iterate():
  1222     def iterate():
  1216         if follow and not match.files():
  1223         if follow and not match.files():
  1217             ff = followfilter(onlyfirst=opts.get('follow_first'))
  1224             ff = followfilter(onlyfirst=opts.get('follow_first'))
  1219                 return ff.match(rev) and rev in wanted
  1226                 return ff.match(rev) and rev in wanted
  1220         else:
  1227         else:
  1221             def want(rev):
  1228             def want(rev):
  1222                 return rev in wanted
  1229                 return rev in wanted
  1223 
  1230 
  1224         for i, window in increasingwindows(0, len(revs)):
  1231         for i, window in increasingwindows(0, len(revs), windowsize):
  1225             nrevs = [rev for rev in revs[i:i + window] if want(rev)]
  1232             nrevs = [rev for rev in revs[i:i + window] if want(rev)]
  1226             for rev in sorted(nrevs):
  1233             for rev in sorted(nrevs):
  1227                 fns = fncache.get(rev)
  1234                 fns = fncache.get(rev)
  1228                 ctx = change(rev)
  1235                 ctx = change(rev)
  1229                 if not fns:
  1236                 if not fns: