Submitter | Alexander Plavin |
---|---|
Date | Aug. 22, 2013, 3:09 p.m. |
Message ID | <ffa9a6d28047bfe18036.1377184169@debian-alexander.dolgopa> |
Download | mbox | patch |
Permalink | /patch/2241/ |
State | Superseded |
Commit | 217f2b9acee0c2bc6056ac650634aa55e42105b2 |
Headers | show |
Comments
Patch
diff -r 16fe12bb559f -r ffa9a6d28047 mercurial/hgweb/webcommands.py --- a/mercurial/hgweb/webcommands.py Thu Aug 22 16:42:10 2013 +0400 +++ b/mercurial/hgweb/webcommands.py Fri Jul 19 02:41:11 2013 +0400 @@ -110,6 +110,9 @@ def _search(web, req, tmpl): + def revsearch(ctx): + yield ctx + def keywordsearch(query): lower = encoding.lower qw = lower(query).split() @@ -139,11 +142,17 @@ yield ctx searchfuncs = { + 'rev': revsearch, 'kw': keywordsearch, } def getsearchmode(query): - return 'kw', query + try: + ctx = web.repo[query] + except (error.RepoError, error.LookupError): + return 'kw', query + else: + return 'rev', ctx def changelist(**map): count = 0