convert: split converters into sink/source
authorBenoit Boissinot <benoit.boissinot@ens-lyon.org>
Sun, 07 Oct 2007 20:44:54 +0200
changeset 5414 eb58722d282f
parent 5413 719fd175181f
child 5415 1d53a75ea0fc
convert: split converters into sink/source
hgext/convert/__init__.py
--- a/hgext/convert/__init__.py	Sun Oct 07 19:03:32 2007 +0200
+++ b/hgext/convert/__init__.py	Sun Oct 07 20:44:54 2007 +0200
@@ -19,11 +19,11 @@
 
 commands.norepo += " convert debugsvnlog"
 
-converters = [convert_cvs, convert_git, convert_svn, mercurial_source,
-              mercurial_sink, darcs_source]
-
+sink_converters = [mercurial_sink]
+source_converters = [convert_cvs, convert_git, convert_svn,
+                     mercurial_source, darcs_source]
 def convertsource(ui, path, **opts):
-    for c in converters:
+    for c in source_converters:
         try:
             return c.getcommit and c(ui, path, **opts)
         except (AttributeError, NoRepo):
@@ -33,7 +33,7 @@
 def convertsink(ui, path):
     if not os.path.isdir(path):
         raise util.Abort("%s: not a directory" % path)
-    for c in converters:
+    for c in sink_converters:
         try:
             return c.putcommit and c(ui, path)
         except (AttributeError, NoRepo):