hgext/convert/convcmd.py
changeset 9962 a7178eccf2dc
parent 9431 d1b135f2f415
child 10264 d6512b3e9ac0
--- a/hgext/convert/convcmd.py	Mon Nov 30 22:23:09 2009 +0100
+++ b/hgext/convert/convcmd.py	Mon Nov 30 22:23:04 2009 +0100
@@ -48,6 +48,8 @@
 
 def convertsource(ui, path, type, rev):
     exceptions = []
+    if type and type not in [s[0] for s in source_converters]:
+        raise util.Abort(_('%s: invalid source repository type') % type)
     for name, source, sortmode in source_converters:
         try:
             if not type or name == type:
@@ -60,6 +62,8 @@
     raise util.Abort(_('%s: missing or unsupported repository') % path)
 
 def convertsink(ui, path, type):
+    if type and type not in [s[0] for s in sink_converters]:
+        raise util.Abort(_('%s: invalid destination repository type') % type)
     for name, sink in sink_converters:
         try:
             if not type or name == type: