mercurial/cmdutil.py
branchstable
changeset 12972 7916a84c0758
parent 12971 15390d1a3cfc
child 12973 6e0a9f9227bd
--- a/mercurial/cmdutil.py	Thu Nov 11 02:05:02 2010 +0900
+++ b/mercurial/cmdutil.py	Thu Nov 11 02:10:37 2010 +0900
@@ -1180,11 +1180,20 @@
 
             # iterate from latest to oldest revision
             for rev, flparentlinkrevs, copied in filerevgen(filelog, last):
-                if rev > maxrev or rev not in ancestors:
-                    continue
-                # XXX insert 1327 fix here
-                if flparentlinkrevs:
-                    ancestors.update(flparentlinkrevs)
+                if not follow:
+                    if rev > maxrev:
+                        continue
+                else:
+                    # Note that last might not be the first interesting
+                    # rev to us:
+                    # if the file has been changed after maxrev, we'll
+                    # have linkrev(last) > maxrev, and we still need
+                    # to explore the file graph
+                    if rev not in ancestors:
+                        continue
+                    # XXX insert 1327 fix here
+                    if flparentlinkrevs:
+                        ancestors.update(flparentlinkrevs)
 
                 fncache.setdefault(rev, []).append(file_)
                 wanted.add(rev)