[PATCH 2 of 2 V2] hgweb: always run search when a query is entered
Alexander Plavin
alexander at plav.in
Tue Aug 6 16:55:59 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 5230d8599bcc722c7f2a4bab4306760de1d558f6
# Parent 6519709f0402a4ca4d28b0f2c0e96e79fa41763b
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.
A new test checks this behaviour and fails for the old one.
diff -r 6519709f0402 -r 5230d8599bcc 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']
diff -r 6519709f0402 -r 5230d8599bcc tests/test-hgweb-commands.t
--- 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
@@ -534,6 +534,8 @@
</body>
</html>
+ $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'log?rev=stable&style=raw' | grep 'revision:'
+ revision: 2
File-related
More information about the Mercurial-devel
mailing list