hgweb: introduction a filerevnav subclass
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Mon, 14 Jan 2013 16:55:48 +0100
changeset 18408 f332a64fef51
parent 18407 50dc5b244474
child 18409 e3f5cef11d6a
hgweb: introduction a filerevnav subclass It'll be use to implement the file specific behavior.
mercurial/hgweb/webcommands.py
mercurial/hgweb/webutil.py
--- a/mercurial/hgweb/webcommands.py	Thu Jan 10 19:09:32 2013 +0100
+++ b/mercurial/hgweb/webcommands.py	Mon Jan 14 16:55:48 2013 +0100
@@ -772,7 +772,7 @@
             yield e
 
     nodefunc = lambda x: fctx.filectx(fileid=x)
-    nav = webutil.revnav(nodefunc).gen(end - 1, revcount, count)
+    nav = webutil.filerevnav(nodefunc).gen(end - 1, revcount, count)
     return tmpl("filelog", file=f, node=fctx.hex(), nav=nav,
                 entries=lambda **x: entries(latestonly=False, **x),
                 latestentry=lambda **x: entries(latestonly=True, **x),
--- a/mercurial/hgweb/webutil.py	Thu Jan 10 19:09:32 2013 +0100
+++ b/mercurial/hgweb/webutil.py	Mon Jan 14 16:55:48 2013 +0100
@@ -93,6 +93,9 @@
         return ({'before': lambda **map: (data(i) for i in navbefore),
                  'after':  lambda **map: (data(i) for i in navafter)},)
 
+class filerevnav(revnav):
+    pass
+
 def _siblings(siblings=[], hiderev=None):
     siblings = [s for s in siblings if s.node() != nullid]
     if len(siblings) == 1 and siblings[0].rev() == hiderev: