[PATCH] hgweb: run search instead of showing wrong error for ambigious identifier

Alexander Plavin me at aplavin.ru
Fri Jul 12 17:16:39 CDT 2013


# HG changeset patch
# User Alexander Plavin <me at 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.

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):


More information about the Mercurial-devel mailing list