# HG changeset patch # User Alexander Plavin # Date 1373836222 -14400 # Node ID 9a020b354d933694bbc4858f36aad396b96aeb9c # Parent b5e3f2b1d5e93bb2c8c850d9249e0e9c8babf129 hgweb: separate search itself and template generation This will make it simpler to add other search modes. diff -r b5e3f2b1d5e9 -r 9a020b354d93 mercurial/hgweb/webcommands.py --- 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)