mercurial/hgweb.py
changeset 1703 41d884f741ca
parent 1653 e8a3df8b62b3
child 1736 50de0887bbcd
child 1777 a2316878f19d
child 1829 b0f6af327fd4
--- a/mercurial/hgweb.py	Mon Feb 06 17:34:39 2006 -0600
+++ b/mercurial/hgweb.py	Mon Feb 06 17:34:53 2006 -0600
@@ -298,19 +298,25 @@
 
     def changelog(self, pos):
         def changenav(**map):
-            def seq(factor=1):
-                yield 1 * factor
-                yield 3 * factor
-                #yield 5 * factor
+            def seq(factor, maxchanges=None):
+                if maxchanges:
+                    yield maxchanges
+                    if maxchanges >= 20 and maxchanges <= 40:
+                        yield 50
+                else:
+                    yield 1 * factor
+                    yield 3 * factor
                 for f in seq(factor * 10):
                     yield f
 
             l = []
-            for f in seq():
-                if f < self.maxchanges / 2:
+            last = 0
+            for f in seq(1, self.maxchanges):
+                if f < self.maxchanges or f <= last:
                     continue
                 if f > count:
                     break
+                last = f
                 r = "%d" % f
                 if pos + f < count:
                     l.append(("+" + r, pos + f))