# HG changeset patch # User Pierre-Yves David # Date 1358109395 -3600 # Node ID 60680d691a0b483f001875213db4660d5abdd5e1 # Parent e350ce798b636975173b0ecd7592f7994069e546 hgweb: document the revnavgen function diff -r e350ce798b63 -r 60680d691a0b mercurial/hgweb/webutil.py --- 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