Mercurial > hg
diff hgext/convert/darcs.py @ 5520:cc3af86ab6fe
test-convert-darcs: skip if we can't find the elementtree module
This patch is a bit dirty to avoid having to repeat the dance required
to import elementtree.
author | Alexis S. L. Carvalho <alexis@cecm.usp.br> |
---|---|
date | Fri, 09 Nov 2007 20:21:35 -0200 |
parents | 003d1f174fe1 |
children | 03496d4fa509 |
line wrap: on
line diff
--- a/hgext/convert/darcs.py Fri Nov 09 20:21:35 2007 -0200 +++ b/hgext/convert/darcs.py Fri Nov 09 20:21:35 2007 -0200 @@ -21,12 +21,17 @@ def __init__(self, ui, path, rev=None): super(darcs_source, self).__init__(ui, path, rev=rev) - if not os.path.exists(os.path.join(path, '_darcs', 'inventory')): + # 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("couldn't open darcs repo %s" % path) 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("couldn't open darcs repo %s" % path) + self.path = os.path.realpath(path) self.lastrev = None