hgweb: fix navigation label (
issue3792)
Latest refactoring (
6da1e979340a) was buggy and used a variable from
another loop. Tests are run on repo too small to cache that.
--- a/mercurial/hgweb/webutil.py Tue Jan 29 20:03:51 2013 +0100
+++ b/mercurial/hgweb/webutil.py Wed Jan 30 17:32:17 2013 +0100
@@ -91,9 +91,9 @@
if rev not in self._revlog:
continue
if pos < rev < limit:
- navafter.append(("+%d" % f, self.hex(rev)))
+ navafter.append(("+%d" % abs(rev - pos), self.hex(rev)))
if 0 < rev < pos:
- navbefore.append(("-%d" % f, self.hex(rev)))
+ navbefore.append(("-%d" % abs(rev - pos), self.hex(rev)))
navafter.append(("tip", "tip"))