diff mercurial/hgweb/hgweb_mod.py @ 3409:1ae738bacf74

Fixed page overlap for file revision links in hgweb. This is another step to fix issue189, but currently the file revision numbers are read as changeset revision numbers, so the link will point to the wrong revision.
author Thomas Arendsen Hein <thomas@intevation.de>
date Mon, 16 Oct 2006 09:53:31 +0200
parents 03e7e8958a27
children 0eba7e76cd02
line wrap: on
line diff
--- a/mercurial/hgweb/hgweb_mod.py
+++ b/mercurial/hgweb/hgweb_mod.py
@@ -310,12 +310,12 @@ class hgweb(object):
         fl = fctx.filelog()
         count = fl.count()
         pagelen = self.maxshortchanges
+        pos = fctx.filerev()
+        start = max(0, pos - pagelen + 1) 
+        end = min(count, start + pagelen)
+        pos = end - 1
 
         def entries(**map):
-            pos = fctx.filerev()
-            start = max(0, pos - pagelen + 1) 
-            end = min(count, start + pagelen)
-            pos = end - 1
             l = []
             parity = (count - 1) & 1
 
@@ -338,7 +338,7 @@ class hgweb(object):
             for e in l:
                 yield e
 
-        nav = revnavgen(fctx.filerev(), self.maxshortchanges, count)
+        nav = revnavgen(pos, pagelen, count)
         yield self.t("filelog", file=f, node=hex(fctx.node()), nav=nav,
                      entries=entries)