Patchwork [05,of,20] hgweb: always compute all entries in search

login
register
mail settings
Submitter Alexander Plavin
Date Aug. 9, 2013, 6:57 p.m.
Message ID <b8d1a5f78bb48a8377ed.1376074650@debian-alexander.dolgopa>
Download mbox | patch
Permalink /patch/2111/
State Changes Requested
Headers show

Comments

Alexander Plavin - Aug. 9, 2013, 6:57 p.m.
# HG changeset patch
# User Alexander Plavin <alexander@plav.in>
# Date 1376045671 -14400
#      Fri Aug 09 14:54:31 2013 +0400
# Node ID b8d1a5f78bb48a8377ed60ea863fa74717114922
# Parent  bd303eb5286b4a5666ee96d4b019dea7d58bac56
hgweb: always compute all entries in search

Get the whole list of entries before rendering instead of using lazy evaluation.
All the entries are shown always anyway, so it doesn't affect performance.

Patch

diff -r bd303eb5286b -r b8d1a5f78bb4 mercurial/hgweb/webcommands.py
--- a/mercurial/hgweb/webcommands.py	Fri Aug 09 14:54:16 2013 +0400
+++ b/mercurial/hgweb/webcommands.py	Fri Aug 09 14:54:31 2013 +0400
@@ -244,8 +244,10 @@ 
     tip = web.repo['tip']
     parity = paritygen(web.stripecount)
 
+    entries = list(changelist())
+
     return tmpl('search', query=query, node=tip.hex(),
-                entries=changelist, archives=web.archivelist("tip"),
+                entries=entries, archives=web.archivelist("tip"),
                 morevars=morevars, lessvars=lessvars,
                 modedesc=searchfunc[1],
                 showforcekw=showforcekw, showunforcekw=showunforcekw)