Fix a couple fencepost errors in hg log
authormpm@selenic.com
Wed, 24 Aug 2005 19:16:45 -0700
changeset 1042 23f9d71ab9ae
parent 1041 3ce272b96494
child 1043 9344f5dd4488
Fix a couple fencepost errors in hg log
mercurial/commands.py
--- a/mercurial/commands.py	Wed Aug 24 18:45:49 2005 -0700
+++ b/mercurial/commands.py	Wed Aug 24 19:16:45 2005 -0700
@@ -866,9 +866,10 @@
     if not slowpath:
         # Only files, no patterns.  Check the history of each file.
         def filerevgen(filelog):
-            for i in xrange(filelog.count() - 1, 0, -window):
+            for i in xrange(filelog.count() - 1, -1, -window):
+                print "filelog"
                 revs = []
-                for j in xrange(max(0, i - window), i):
+                for j in xrange(max(0, i - window), i + 1):
                     revs.append(filelog.linkrev(filelog.node(j)))
                 revs.reverse()
                 for rev in revs:
@@ -888,8 +889,8 @@
     if slowpath:
         # The slow path checks files modified in every changeset.
         def mfrevgen():
-            for i in xrange(repo.changelog.count() - 1, 0, -window):
-                for j in xrange(max(0, i - window), i):
+            for i in xrange(repo.changelog.count() - 1, -1, -window):
+                for j in xrange(max(0, i - window), i + 1):
                     yield j, repo.changelog.read(repo.lookup(str(j)))[3]
 
         for rev, mf in mfrevgen():