--- 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