##// 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 revcount = web.maxchanges
108 revcount = web.maxchanges
109 if 'revcount' in req.form:
109 if 'revcount' in req.form:
110 revcount = int(req.form.get('revcount', [revcount])[0])
110 revcount = int(req.form.get('revcount', [revcount])[0])
111 revcount = max(revcount, 1)
111 tmpl.defaults['sessionvars']['revcount'] = revcount
112 tmpl.defaults['sessionvars']['revcount'] = revcount
112
113
113 lessvars = copy.copy(tmpl.defaults['sessionvars'])
114 lessvars = copy.copy(tmpl.defaults['sessionvars'])
114 lessvars['revcount'] = revcount / 2
115 lessvars['revcount'] = max(revcount / 2, 1)
115 lessvars['rev'] = query
116 lessvars['rev'] = query
116 morevars = copy.copy(tmpl.defaults['sessionvars'])
117 morevars = copy.copy(tmpl.defaults['sessionvars'])
117 morevars['revcount'] = revcount * 2
118 morevars['revcount'] = revcount * 2
@@ -220,10 +221,11 b' def changelog(web, req, tmpl, shortlog=F'
220 revcount = shortlog and web.maxshortchanges or web.maxchanges
221 revcount = shortlog and web.maxshortchanges or web.maxchanges
221 if 'revcount' in req.form:
222 if 'revcount' in req.form:
222 revcount = int(req.form.get('revcount', [revcount])[0])
223 revcount = int(req.form.get('revcount', [revcount])[0])
224 revcount = max(revcount, 1)
223 tmpl.defaults['sessionvars']['revcount'] = revcount
225 tmpl.defaults['sessionvars']['revcount'] = revcount
224
226
225 lessvars = copy.copy(tmpl.defaults['sessionvars'])
227 lessvars = copy.copy(tmpl.defaults['sessionvars'])
226 lessvars['revcount'] = revcount / 2
228 lessvars['revcount'] = max(revcount / 2, 1)
227 morevars = copy.copy(tmpl.defaults['sessionvars'])
229 morevars = copy.copy(tmpl.defaults['sessionvars'])
228 morevars['revcount'] = revcount * 2
230 morevars['revcount'] = revcount * 2
229
231
@@ -630,10 +632,11 b' def filelog(web, req, tmpl):'
630 revcount = web.maxshortchanges
632 revcount = web.maxshortchanges
631 if 'revcount' in req.form:
633 if 'revcount' in req.form:
632 revcount = int(req.form.get('revcount', [revcount])[0])
634 revcount = int(req.form.get('revcount', [revcount])[0])
635 revcount = max(revcount, 1)
633 tmpl.defaults['sessionvars']['revcount'] = revcount
636 tmpl.defaults['sessionvars']['revcount'] = revcount
634
637
635 lessvars = copy.copy(tmpl.defaults['sessionvars'])
638 lessvars = copy.copy(tmpl.defaults['sessionvars'])
636 lessvars['revcount'] = revcount / 2
639 lessvars['revcount'] = max(revcount / 2, 1)
637 morevars = copy.copy(tmpl.defaults['sessionvars'])
640 morevars = copy.copy(tmpl.defaults['sessionvars'])
638 morevars['revcount'] = revcount * 2
641 morevars['revcount'] = revcount * 2
639
642
@@ -731,10 +734,11 b' def graph(web, req, tmpl):'
731 revcount = web.maxshortchanges
734 revcount = web.maxshortchanges
732 if 'revcount' in req.form:
735 if 'revcount' in req.form:
733 revcount = int(req.form.get('revcount', [revcount])[0])
736 revcount = int(req.form.get('revcount', [revcount])[0])
737 revcount = max(revcount, 1)
734 tmpl.defaults['sessionvars']['revcount'] = revcount
738 tmpl.defaults['sessionvars']['revcount'] = revcount
735
739
736 lessvars = copy.copy(tmpl.defaults['sessionvars'])
740 lessvars = copy.copy(tmpl.defaults['sessionvars'])
737 lessvars['revcount'] = revcount / 2
741 lessvars['revcount'] = max(revcount / 2, 1)
738 morevars = copy.copy(tmpl.defaults['sessionvars'])
742 morevars = copy.copy(tmpl.defaults['sessionvars'])
739 morevars['revcount'] = revcount * 2
743 morevars['revcount'] = revcount * 2
740
744
General Comments 0
You need to be logged in to leave comments. Login now