mercurial/cmdutil.py
changeset 11609 890ad9d6a169
parent 11608 183e63112698
child 11613 e8b9942f5254
--- a/mercurial/cmdutil.py	Sat Jul 03 18:11:15 2010 +0900
+++ b/mercurial/cmdutil.py	Sun Jul 04 18:07:30 2010 +0900
@@ -1106,16 +1106,20 @@
                                'filenames'))
 
         # The slow path checks files modified in every changeset.
-        def changerevgen():
-            for i, window in increasing_windows(len(repo) - 1, nullrev):
-                for j in xrange(i - window, i + 1):
-                    yield change(j)
-
-        for ctx in changerevgen():
+        if opts.get('removed'):
+            # --removed wants to yield the changes where the file
+            # was removed, this means that we have to explore all
+            # changesets, effectively ignoring the revisions that
+            # had been passed as arguments
+            revrange = xrange(nullrev, len(repo) - 1)
+        else:
+            revrange = sorted(revs)
+        for i in revrange:
+            ctx = change(i)
             matches = filter(match, ctx.files())
             if matches:
-                fncache[ctx.rev()] = matches
-                wanted.add(ctx.rev())
+                fncache[i] = matches
+                wanted.add(i)
 
     class followfilter(object):
         def __init__(self, onlyfirst=False):