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

login
register
mail settings
Submitter Matt Harbison
Date May 22, 2018, 3:17 a.m.
Message ID <c137053c30e3a477d9f2.1526959029@Envy>
Download mbox | patch
Permalink /patch/31802/
State Accepted
Headers show

Comments

Matt Harbison - May 22, 2018, 3:17 a.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@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.

Patch

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)