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

login
register
mail settings
Submitter Pierre-Yves David
Date Jan. 11, 2013, 12:23 a.m.
Message ID <07aa6cd3e20a89210cda.1357863831@yamac.lan>
Download mbox | patch
Permalink /patch/551/
State Accepted
Commit 60680d691a0b483f001875213db4660d5abdd5e1
Headers show

Comments

Pierre-Yves David - Jan. 11, 2013, 12:23 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@logilab.fr>
# Date 1357862521 -3600
# Node ID 07aa6cd3e20a89210cda4496d888fdec2cf23901
# Parent  5e317515a6823d949486a5367eed2ea248e55063
hgweb: document the revnavgen function

Patch

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