[PATCH 4 of 4] hgweb: always run search when a query is entered

Alexander Plavin alexander at plav.in
Fri Aug 2 16:55:43 CDT 2013


# HG changeset patch
# User Alexander Plavin <alexander at plav.in>
# Date 1374185353 -14400
#      Fri Jul 19 02:09:13 2013 +0400
# Node ID b803e7ec8094366b8a3f9d46fb6f79c63b7b673e
# Parent  9a4e5f7309fb53e800d0ada415ce4944ef241704
hgweb: always run search when a query is entered

This changes the behavior for queries which point at a revision directly,
now the output is consistend to other cases: it results in only this matched
revision shown, not the log starting with it.

diff -r 9a4e5f7309fb -r b803e7ec8094 mercurial/hgweb/webcommands.py
--- a/mercurial/hgweb/webcommands.py	Fri Jul 19 02:41:11 2013 +0400
+++ b/mercurial/hgweb/webcommands.py	Fri Jul 19 02:09:13 2013 +0400
@@ -210,11 +210,7 @@
     if 'node' in req.form:
         ctx = webutil.changectx(web.repo, req)
     elif 'rev' in req.form:
-        query = req.form['rev'][0]
-        try:
-            ctx = web.repo[query]
-        except (error.RepoError, error.LookupError):
-            return _search(web, req, tmpl) # XXX redirect to 404 page?
+        return _search(web, req, tmpl)
     else:
         ctx = web.repo['tip']
 


More information about the Mercurial-devel mailing list