##// END OF EJS Templates
hgweb: add dynamic search function selection, depending on the query...
Alexander Plavin -
r19631:cf9e5e45 default
parent child Browse files
Show More
@@ -138,10 +138,17 b' def _search(web, req, tmpl):'
138
138
139 yield ctx
139 yield ctx
140
140
141 searchfuncs = {
142 'keyword': keywordsearch,
143 }
144
145 def getsearchmode():
146 return 'keyword'
147
141 def changelist(**map):
148 def changelist(**map):
142 count = 0
149 count = 0
143
150
144 for ctx in keywordsearch():
151 for ctx in searchfunc():
145 count += 1
152 count += 1
146 n = ctx.node()
153 n = ctx.node()
147 showtags = webutil.showtag(web.repo, tmpl, 'changelogtag', n)
154 showtags = webutil.showtag(web.repo, tmpl, 'changelogtag', n)
@@ -181,6 +188,9 b' def _search(web, req, tmpl):'
181 morevars['revcount'] = revcount * 2
188 morevars['revcount'] = revcount * 2
182 morevars['rev'] = query
189 morevars['rev'] = query
183
190
191 mode = getsearchmode()
192 searchfunc = searchfuncs[mode]
193
184 tip = web.repo['tip']
194 tip = web.repo['tip']
185 parity = paritygen(web.stripecount)
195 parity = paritygen(web.stripecount)
186
196
General Comments 0
You need to be logged in to leave comments. Login now