mercurial/commands.py
changeset 1800 414e81ae971f
parent 1799 b942f5cfd326
child 1801 38e19b1d3de8
child 1907 7718885070b1
equal deleted inserted replaced
1799:b942f5cfd326 1800:414e81ae971f
   120     if not slowpath:
   120     if not slowpath:
   121         # Only files, no patterns.  Check the history of each file.
   121         # Only files, no patterns.  Check the history of each file.
   122         def filerevgen(filelog):
   122         def filerevgen(filelog):
   123             for i, window in increasing_windows(filelog.count()-1, -1):
   123             for i, window in increasing_windows(filelog.count()-1, -1):
   124                 revs = []
   124                 revs = []
   125                 for j in xrange(max(0, i - window), i + 1):
   125                 for j in xrange(i - window, i + 1):
   126                     revs.append(filelog.linkrev(filelog.node(j)))
   126                     revs.append(filelog.linkrev(filelog.node(j)))
   127                 revs.reverse()
   127                 revs.reverse()
   128                 for rev in revs:
   128                 for rev in revs:
   129                     yield rev
   129                     yield rev
   130 
   130 
   145                     wanted[rev] = 1
   145                     wanted[rev] = 1
   146     if slowpath:
   146     if slowpath:
   147         # The slow path checks files modified in every changeset.
   147         # The slow path checks files modified in every changeset.
   148         def changerevgen():
   148         def changerevgen():
   149             for i, window in increasing_windows(repo.changelog.count()-1, -1):
   149             for i, window in increasing_windows(repo.changelog.count()-1, -1):
   150                 for j in xrange(max(0, i - window), i + 1):
   150                 for j in xrange(i - window, i + 1):
   151                     yield j, getchange(j)[3]
   151                     yield j, getchange(j)[3]
   152 
   152 
   153         for rev, changefiles in changerevgen():
   153         for rev, changefiles in changerevgen():
   154             matches = filter(matchfn, changefiles)
   154             matches = filter(matchfn, changefiles)
   155             if matches:
   155             if matches:
   157                 wanted[rev] = 1
   157                 wanted[rev] = 1
   158 
   158 
   159     def iterate():
   159     def iterate():
   160         for i, window in increasing_windows(0, len(revs)):
   160         for i, window in increasing_windows(0, len(revs)):
   161             yield 'window', revs[0] < revs[-1], revs[-1]
   161             yield 'window', revs[0] < revs[-1], revs[-1]
   162             nrevs = [rev for rev in revs[i:min(i+window, len(revs))]
   162             nrevs = [rev for rev in revs[i:i+window]
   163                      if rev in wanted]
   163                      if rev in wanted]
   164             srevs = list(nrevs)
   164             srevs = list(nrevs)
   165             srevs.sort()
   165             srevs.sort()
   166             for rev in srevs:
   166             for rev in srevs:
   167                 fns = fncache.get(rev) or filter(matchfn, getchange(rev)[3])
   167                 fns = fncache.get(rev) or filter(matchfn, getchange(rev)[3])