hgweb: simplify addition of "(0) navigation entry"
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Thu, 10 Jan 2013 19:09:32 +0100
changeset 18407 50dc5b244474
parent 18406 20cf53932b6f
child 18408 f332a64fef51
hgweb: simplify addition of "(0) navigation entry"
mercurial/hgweb/webutil.py
--- a/mercurial/hgweb/webutil.py	Mon Jan 14 16:30:06 2013 +0100
+++ b/mercurial/hgweb/webutil.py	Thu Jan 10 19:09:32 2013 +0100
@@ -76,7 +76,7 @@
             # empty repo
             return ({'before': (), 'after': ()},)
 
-        navbefore = []
+        navbefore = [("(0)", self.hex(0))]
         navafter = []
 
         for f in _navseq(1, pagelen):
@@ -88,7 +88,6 @@
                 navbefore.insert(0, ("-%d" % f, self.hex(pos - f)))
 
         navafter.append(("tip", "tip"))
-        navbefore.insert(0, ("(0)", self.hex(0)))
 
         data = lambda i: {"label": i[0], "node": i[1]}
         return ({'before': lambda **map: (data(i) for i in navbefore),