changeset 18320:60680d691a0b

hgweb: document the revnavgen function
author Pierre-Yves David <pierre-yves.david@logilab.fr>
date Sun, 13 Jan 2013 21:36:35 +0100
parents e350ce798b63
children 2eae2f9e85ef
files mercurial/hgweb/webutil.py
diffstat 1 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hgweb/webutil.py	Wed Dec 19 19:06:50 2012 +0100
+++ b/mercurial/hgweb/webutil.py	Sun Jan 13 21:36:35 2013 +0100
@@ -25,6 +25,19 @@
     return up + "/"
 
 def revnavgen(pos, pagelen, limit, nodefunc):
+    """computes label and revision id for navigation link
+
+    :pos: is the revision relative to which we generate navigation.
+    :pagelen: the size of each navigation page
+    :limit: how far shall we link
+    :nodefun: factory for a changectx from a revision
+
+    The return is:
+        - a single element tuple
+        - containing a dictionary with a `before` and `after` key
+        - values are generator functions taking an arbitrary number of kwargs
+        - yield items are dictionaries with `label` and `node` keys
+    """
     def seq(factor, limit=None):
         if limit:
             yield limit