[PATCH 06 of 23 Series-D] hgweb: document the revnavgen function

Pierre-Yves David pierre-yves.david at ens-lyon.org
Thu Jan 10 18:23:51 CST 2013


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at logilab.fr>
# Date 1357862521 -3600
# Node ID 07aa6cd3e20a89210cda4496d888fdec2cf23901
# Parent  5e317515a6823d949486a5367eed2ea248e55063
hgweb: document the revnavgen function

diff --git a/mercurial/hgweb/webutil.py b/mercurial/hgweb/webutil.py
--- a/mercurial/hgweb/webutil.py
+++ b/mercurial/hgweb/webutil.py
@@ -23,10 +23,23 @@ def up(p):
     if up == "/":
         return "/"
     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 since of each navigation pages
+    :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 function taking arbitrary number of kwargs
+        - yield items are dictionnary with `label` and `node` key
+    """
     def seq(factor, limit=None):
         if limit:
             yield limit
             if limit >= 20 and limit <= 40:
                 yield 50


More information about the Mercurial-devel mailing list