# HG changeset patch # User Pierre-Yves David # Date 2013-01-30 16:32:17 # Node ID 7f769d3a8ad241d689a3011fb21f4b04f84f3712 # Parent 68eecbaf1bd32a616748331cc9f22d55b1316ce3 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. diff --git a/mercurial/hgweb/webutil.py b/mercurial/hgweb/webutil.py --- a/mercurial/hgweb/webutil.py +++ b/mercurial/hgweb/webutil.py @@ -91,9 +91,9 @@ class revnav(object): 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"))