##// END OF EJS Templates
hgweb: set minimum number of revision to display to 1 when revcount is 0...
Md. O. Shayan -
r13931:c3372529 default
parent child Browse files
Show More
@@ -108,10 +108,11 b' def _search(web, req, tmpl):'
108 108 revcount = web.maxchanges
109 109 if 'revcount' in req.form:
110 110 revcount = int(req.form.get('revcount', [revcount])[0])
111 revcount = max(revcount, 1)
111 112 tmpl.defaults['sessionvars']['revcount'] = revcount
112 113
113 114 lessvars = copy.copy(tmpl.defaults['sessionvars'])
114 lessvars['revcount'] = revcount / 2
115 lessvars['revcount'] = max(revcount / 2, 1)
115 116 lessvars['rev'] = query
116 117 morevars = copy.copy(tmpl.defaults['sessionvars'])
117 118 morevars['revcount'] = revcount * 2
@@ -220,10 +221,11 b' def changelog(web, req, tmpl, shortlog=F'
220 221 revcount = shortlog and web.maxshortchanges or web.maxchanges
221 222 if 'revcount' in req.form:
222 223 revcount = int(req.form.get('revcount', [revcount])[0])
224 revcount = max(revcount, 1)
223 225 tmpl.defaults['sessionvars']['revcount'] = revcount
224 226
225 227 lessvars = copy.copy(tmpl.defaults['sessionvars'])
226 lessvars['revcount'] = revcount / 2
228 lessvars['revcount'] = max(revcount / 2, 1)
227 229 morevars = copy.copy(tmpl.defaults['sessionvars'])
228 230 morevars['revcount'] = revcount * 2
229 231
@@ -630,10 +632,11 b' def filelog(web, req, tmpl):'
630 632 revcount = web.maxshortchanges
631 633 if 'revcount' in req.form:
632 634 revcount = int(req.form.get('revcount', [revcount])[0])
635 revcount = max(revcount, 1)
633 636 tmpl.defaults['sessionvars']['revcount'] = revcount
634 637
635 638 lessvars = copy.copy(tmpl.defaults['sessionvars'])
636 lessvars['revcount'] = revcount / 2
639 lessvars['revcount'] = max(revcount / 2, 1)
637 640 morevars = copy.copy(tmpl.defaults['sessionvars'])
638 641 morevars['revcount'] = revcount * 2
639 642
@@ -731,10 +734,11 b' def graph(web, req, tmpl):'
731 734 revcount = web.maxshortchanges
732 735 if 'revcount' in req.form:
733 736 revcount = int(req.form.get('revcount', [revcount])[0])
737 revcount = max(revcount, 1)
734 738 tmpl.defaults['sessionvars']['revcount'] = revcount
735 739
736 740 lessvars = copy.copy(tmpl.defaults['sessionvars'])
737 lessvars['revcount'] = revcount / 2
741 lessvars['revcount'] = max(revcount / 2, 1)
738 742 morevars = copy.copy(tmpl.defaults['sessionvars'])
739 743 morevars['revcount'] = revcount * 2
740 744
General Comments 0
You need to be logged in to leave comments. Login now