comparison mercurial/hgweb/webutil.py @ 18391:833eb34e90e4

hgweb: better names for _navseq arguments The old names were misleading.
author Pierre-Yves David <pierre-yves.david@logilab.fr>
date Thu, 10 Jan 2013 18:47:48 +0100
parents 28fa9443f751
children 88a37b19dc0e
comparison
equal deleted inserted replaced
18390:28fa9443f751 18391:833eb34e90e4
22 up = os.path.dirname(p) 22 up = os.path.dirname(p)
23 if up == "/": 23 if up == "/":
24 return "/" 24 return "/"
25 return up + "/" 25 return up + "/"
26 26
27 def _navseq(factor, limit=None): 27 def _navseq(step, firststep=None):
28 if limit: 28 if firststep:
29 yield limit 29 yield firststep
30 if limit >= 20 and limit <= 40: 30 if firststep >= 20 and firststep <= 40:
31 yield 50 31 yield 50
32 factor *= 10 32 step *= 10
33 while True: 33 while True:
34 yield 1 * factor 34 yield 1 * step
35 yield 3 * factor 35 yield 3 * step
36 factor *= 10 36 step *= 10
37 37
38 def revnavgen(pos, pagelen, limit, nodefunc): 38 def revnavgen(pos, pagelen, limit, nodefunc):
39 """computes label and revision id for navigation link 39 """computes label and revision id for navigation link
40 40
41 :pos: is the revision relative to which we generate navigation. 41 :pos: is the revision relative to which we generate navigation.