Mercurial > public > mercurial-scm > hg
comparison mercurial/hgweb/webcommands.py @ 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 | 60ce14e41faf |
comparison
equal
deleted
inserted
replaced
19633:217f2b9acee0 | 19634:49a068b8fb0c |
---|---|
211 | 211 |
212 query = '' | 212 query = '' |
213 if 'node' in req.form: | 213 if 'node' in req.form: |
214 ctx = webutil.changectx(web.repo, req) | 214 ctx = webutil.changectx(web.repo, req) |
215 elif 'rev' in req.form: | 215 elif 'rev' in req.form: |
216 query = req.form['rev'][0] | 216 return _search(web, req, tmpl) |
217 try: | |
218 ctx = web.repo[query] | |
219 except (error.RepoError, error.LookupError): | |
220 return _search(web, req, tmpl) # XXX redirect to 404 page? | |
221 else: | 217 else: |
222 ctx = web.repo['tip'] | 218 ctx = web.repo['tip'] |
223 | 219 |
224 def changelist(latestonly, **map): | 220 def changelist(latestonly, **map): |
225 revs = [] | 221 revs = [] |