mercurial/cmdutil.py
changeset 12973 6e0a9f9227bd
parent 12925 6eab8f0df2ca
parent 12972 7916a84c0758
child 13047 6c375e07d673
--- a/mercurial/cmdutil.py	Fri Nov 12 01:22:46 2010 -0600
+++ b/mercurial/cmdutil.py	Sat Nov 13 11:58:51 2010 +0900
@@ -1143,7 +1143,7 @@
                     continue
                 # only yield rev for which we have the changelog, it can
                 # happen while doing "hg log" during a pull or commit
-                if linkrev > maxrev or linkrev >= cl_count:
+                if linkrev >= cl_count:
                     break
 
                 parentlinkrevs = []
@@ -1185,11 +1185,20 @@
 
             # iterate from latest to oldest revision
             for rev, flparentlinkrevs, copied in filerevgen(filelog, last):
-                if 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)