hgweb: separate search itself and template generation
This will make it simpler to add other search modes.
--- a/mercurial/hgweb/webcommands.py Sat Aug 03 00:34:56 2013 +0400
+++ b/mercurial/hgweb/webcommands.py Mon Jul 15 01:10:22 2013 +0400
@@ -110,8 +110,7 @@
def _search(web, req, tmpl):
- def changelist(**map):
- count = 0
+ def keywordsearch():
lower = encoding.lower
qw = lower(query).split()
@@ -137,6 +136,12 @@
if miss:
continue
+ yield ctx
+
+ def changelist(**map):
+ count = 0
+
+ for ctx in keywordsearch():
count += 1
n = ctx.node()
showtags = webutil.showtag(web.repo, tmpl, 'changelogtag', n)