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

Alexander Plavin alexander at plav.in
Fri Aug 9 13:57:30 CDT 2013


# HG changeset patch
# User Alexander Plavin <alexander at 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.

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)


More information about the Mercurial-devel mailing list