diff mercurial/hgweb/webcommands.py @ 18497:a58d8936647a stable

hgweb: prevent traceback during search when filtered (issue3783) The search needs to iterate over the repo using changelog.revs like the rest of the Mercurial code.
author Pierre-Yves David <pierre-yves.david@logilab.fr>
date Tue, 29 Jan 2013 16:44:51 +0100
parents 886936ecc21b
children 66ae2ded0968
line wrap: on
line diff
--- a/mercurial/hgweb/webcommands.py	Sun Jan 27 15:13:53 2013 -0600
+++ b/mercurial/hgweb/webcommands.py	Tue Jan 29 16:44:51 2013 +0100
@@ -129,9 +129,10 @@
         qw = lower(query).split()
 
         def revgen():
+            cl = web.repo.changelog
             for i in xrange(len(web.repo) - 1, 0, -100):
                 l = []
-                for j in xrange(max(0, i - 100), i + 1):
+                for j in cl.revs(max(0, i - 100), i + 1):
                     ctx = web.repo[j]
                     l.append(ctx)
                 l.reverse()