[PATCH 6 of 6] Initialize source repository after destination one

Edouard Gomez ed.gomez at free.fr
Thu Jun 7 16:50:23 CDT 2007


# HG changeset patch
# User Edouard Gomez <ed.gomez at free.fr>
# Date 1181250972 -7200
# Node ID e754f78563698994be022aaf8160a8a7f8e9a75f
# Parent  c5f1b02be4b37a21dd76f8365cd77e8813a3a82f
Initialize source repository after destination one

diff --git a/hgext/convert/__init__.py b/hgext/convert/__init__.py
--- a/hgext/convert/__init__.py
+++ b/hgext/convert/__init__.py
@@ -744,10 +744,6 @@ def _convert(ui, src, dest=None, mapfile
     be run repeatedly to copy new commits.
     '''
 
-    srcc = converter(ui, src)
-    if not hasattr(srcc, "getcommit"):
-        raise util.Abort("%s: can't read from this repo type\n" % src)
-
     if not dest:
         dest = src + "-hg"
         ui.status("assuming destination %s\n" % dest)
@@ -777,6 +773,10 @@ mercurial repository
     if not hasattr(destc, "putcommit"):
         raise util.Abort("%s: can't write to this repo type\n" % src)
 
+    srcc = converter(ui, src)
+    if not hasattr(srcc, "getcommit"):
+        raise util.Abort("%s: can't read from this repo type\n" % src)
+
     if not mapfile:
         try:
             mapfile = destc.mapfile()


More information about the Mercurial-devel mailing list