hgweb: fix navigation label (issue3792) stable
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Wed, 30 Jan 2013 17:32:17 +0100
branchstable
changeset 18503 7f769d3a8ad2
parent 18502 68eecbaf1bd3
child 18504 d1d5fdcc2d46
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.
mercurial/hgweb/webutil.py
--- 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"))