# HG changeset patch # User Pierre-Yves David # Date 1359474291 -3600 # Node ID a58d8936647aa270854cd919fe8e8b2da1c1c669 # Parent d1c13a4dc638cefc71728da24f91a723313b049e 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. diff -r d1c13a4dc638 -r a58d8936647a mercurial/hgweb/webcommands.py --- 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() diff -r d1c13a4dc638 -r a58d8936647a tests/test-hgweb-commands.t --- a/tests/test-hgweb-commands.t Sun Jan 27 15:13:53 2013 -0600 +++ b/tests/test-hgweb-commands.t Tue Jan 29 16:44:51 2013 +0100 @@ -1392,4 +1392,12 @@ $ QUERY_STRING='cmd=listkeys&namespace=bookmarks' $ python hgweb.cgi +search works with filtering + + $ PATH_INFO=/log; export PATH_INFO + $ QUERY_STRING='rev=babar' + $ python hgweb.cgi > search + $ grep Status search + Status: 200 Script output follows\r (esc) + $ cd ..