hgweb: ensure _navseq yield strictly increasing numbers
This is not hard and allows to drop hack in the customer code.
--- a/mercurial/hgweb/webutil.py Thu Jan 10 18:47:48 2013 +0100
+++ b/mercurial/hgweb/webutil.py Thu Jan 10 18:52:17 2013 +0100
@@ -28,8 +28,12 @@
if firststep:
yield firststep
if firststep >= 20 and firststep <= 40:
- yield 50
- step *= 10
+ firststep = 50
+ yield firststep
+ assert step > 0
+ assert firststep > 0
+ while step <= firststep:
+ step *= 10
while True:
yield 1 * step
yield 3 * step
@@ -53,13 +57,9 @@
navbefore = []
navafter = []
- last = 0
for f in _navseq(1, pagelen):
- if f < pagelen or f <= last:
- continue
if f > limit:
break
- last = f
if pos + f < limit:
navafter.append(("+%d" % f, hex(nodefunc(pos + f).node())))
if pos - f >= 0: