[PATCH 4 of 5] show: also catch AmbiguousCommand

Gregory Szorc gregory.szorc at gmail.com
Tue Jul 4 00:32:40 EDT 2017


# HG changeset patch
# User Gregory Szorc <gregory.szorc at gmail.com>
# Date 1499141912 25200
#      Mon Jul 03 21:18:32 2017 -0700
# Node ID b34900769c27a137fa31b86d88d9e09e29f15d4a
# Parent  98ad38a7e25c0fca06cac849e5f68bd3c0cc82bb
show: also catch AmbiguousCommand

cmdutil.findcmd() can raise this as well. While we'll almost certainly
never encounter this in the wild, guard against it regardless.

diff --git a/hgext/show.py b/hgext/show.py
--- a/hgext/show.py
+++ b/hgext/show.py
@@ -233,7 +233,7 @@ def showstack(ui, repo, displayer):
     try:
         cmdutil.findcmd('rebase', commands.table)
         haverebase = True
-    except error.UnknownCommand:
+    except (error.AmbiguousCommand, error.UnknownCommand):
         haverebase = False
 
     # TODO use templating.


More information about the Mercurial-devel mailing list