changeset 19634:49a068b8fb0c

hgweb: always run search when a query is entered (bc) This changes the behavior for queries which point at a revision directly, now the output is consistent to other cases: it results in only this matched revision shown, not the log starting with it. A new test checks this behaviour and fails for the old one.
author Alexander Plavin <alexander@plav.in>
date Fri, 19 Jul 2013 02:09:13 +0400
parents 217f2b9acee0
children b9b7dc267e9f
files mercurial/hgweb/webcommands.py tests/test-hgweb-commands.t
diffstat 2 files changed, 3 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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
@@ -213,11 +213,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']
 
--- a/tests/test-hgweb-commands.t	Fri Jul 19 02:41:11 2013 +0400
+++ b/tests/test-hgweb-commands.t	Fri Jul 19 02:09:13 2013 +0400
@@ -537,6 +537,8 @@
   </body>
   </html>
   
+  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'log?rev=stable&style=raw' | grep 'revision:'
+  revision:    2
 
 File-related