[PATCH 2 of 5] githelp: cleanly abort if the `svn` command is unknown

Matt Harbison mharbison72 at gmail.com
Mon May 21 23:17:09 EDT 2018


# HG changeset patch
# User Matt Harbison <matt_harbison at yahoo.com>
# Date 1526956915 14400
#      Mon May 21 22:41:55 2018 -0400
# Node ID c137053c30e3a477d9f27aa72f0f791d5bcbe5b2
# Parent  a34bed7475cc8237665aa8a3febc1237a090bc20
githelp: cleanly abort if the `svn` command is unknown

Previously, the warning was lost above the sea of KeyError stacktrace output.

diff --git a/hgext/githelp.py b/hgext/githelp.py
--- a/hgext/githelp.py
+++ b/hgext/githelp.py
@@ -963,7 +963,7 @@ def svn(ui, repo, *args, **kwargs):
         raise error.Abort(_('missing svn command'))
     svncmd = args[0]
     if not svncmd in gitsvncommands:
-        ui.warn(_("error: unknown git svn command %s\n") % (svncmd))
+        raise error.Abort(_('unknown git svn command "%s"') % (svncmd))
 
     args = args[1:]
     return gitsvncommands[svncmd](ui, repo, *args, **kwargs)


More information about the Mercurial-devel mailing list