Patchwork hgweb: run search instead of showing wrong error for ambigious identifier

login
register
mail settings
Submitter Alexander Plavin
Date July 12, 2013, 10:16 p.m.
Message ID <f6775d51fb76b4f39305.1373667399@debian-alexander.dolgopa>
Download mbox | patch
Permalink /patch/1852/
State Accepted
Commit f5abfa08fb094ac8a60649f2a497a1d6bdd88b56
Headers show

Comments

Alexander Plavin - July 12, 2013, 10:16 p.m.
# HG changeset patch
# User Alexander Plavin <me@aplavin.ru>
# Date 1373579928 -14400
#      Fri Jul 12 01:58:48 2013 +0400
# Node ID f6775d51fb76b4f393050eb1350d42b2c4676784
# Parent  85e44ad965f6141de53e78a5bcf64486489c3604
hgweb: run search instead of showing wrong error for ambigious identifier

Before this when multiple changesets hashes in the repos started with the
search query string, error was given that the revision isn't found, and it
was misleading. Now a simple keyword search runs in this case.

Patch

diff -r 85e44ad965f6 -r f6775d51fb76 mercurial/hgweb/webcommands.py
--- a/mercurial/hgweb/webcommands.py	Tue Jul 09 02:08:24 2013 +0400
+++ b/mercurial/hgweb/webcommands.py	Fri Jul 12 01:58:48 2013 +0400
@@ -194,7 +194,7 @@ 
             hi = 'tip'
         try:
             ctx = web.repo[hi]
-        except error.RepoError:
+        except (error.RepoError, error.LookupError):
             return _search(web, req, tmpl) # XXX redirect to 404 page?
 
     def changelist(latestonly, **map):