hgext/convert/darcs.py
changeset 5528 6ffca2bf23da
parent 5512 8cd26ccc68f8
parent 5521 03496d4fa509
child 6762 f67d1468ac50
--- a/hgext/convert/darcs.py	Wed Nov 07 21:13:56 2007 -0600
+++ b/hgext/convert/darcs.py	Fri Nov 09 21:24:25 2007 -0200
@@ -22,14 +22,19 @@
         converter_source.__init__(self, ui, path, rev=rev)
         commandline.__init__(self, ui, 'darcs')
 
-        if not os.path.exists(os.path.join(path, '_darcs', 'inventory')):
-            raise NoRepo("couldn't open darcs repo %s" % path)
+        # check for _darcs, ElementTree, _darcs/inventory so that we can
+        # easily skip test-convert-darcs if ElementTree is not around
+        if not os.path.exists(os.path.join(path, '_darcs')):
+            raise NoRepo("%s does not look like a darcs repo" % path)
 
         checktool('darcs')
 
         if ElementTree is None:
             raise util.Abort(_("Python ElementTree module is not available"))
 
+        if not os.path.exists(os.path.join(path, '_darcs', 'inventory')):
+            raise NoRepo("%s does not look like a darcs repo" % path)
+
         self.path = os.path.realpath(path)
 
         self.lastrev = None