hgext/convert/darcs.py
changeset 5528 6ffca2bf23da
parent 5512 8cd26ccc68f8
parent 5521 03496d4fa509
child 6762 f67d1468ac50
equal deleted inserted replaced
5515:b11c855cde96 5528:6ffca2bf23da
    20 class darcs_source(converter_source, commandline):
    20 class darcs_source(converter_source, commandline):
    21     def __init__(self, ui, path, rev=None):
    21     def __init__(self, ui, path, rev=None):
    22         converter_source.__init__(self, ui, path, rev=rev)
    22         converter_source.__init__(self, ui, path, rev=rev)
    23         commandline.__init__(self, ui, 'darcs')
    23         commandline.__init__(self, ui, 'darcs')
    24 
    24 
    25         if not os.path.exists(os.path.join(path, '_darcs', 'inventory')):
    25         # check for _darcs, ElementTree, _darcs/inventory so that we can
    26             raise NoRepo("couldn't open darcs repo %s" % path)
    26         # easily skip test-convert-darcs if ElementTree is not around
       
    27         if not os.path.exists(os.path.join(path, '_darcs')):
       
    28             raise NoRepo("%s does not look like a darcs repo" % path)
    27 
    29 
    28         checktool('darcs')
    30         checktool('darcs')
    29 
    31 
    30         if ElementTree is None:
    32         if ElementTree is None:
    31             raise util.Abort(_("Python ElementTree module is not available"))
    33             raise util.Abort(_("Python ElementTree module is not available"))
       
    34 
       
    35         if not os.path.exists(os.path.join(path, '_darcs', 'inventory')):
       
    36             raise NoRepo("%s does not look like a darcs repo" % path)
    32 
    37 
    33         self.path = os.path.realpath(path)
    38         self.path = os.path.realpath(path)
    34 
    39 
    35         self.lastrev = None
    40         self.lastrev = None
    36         self.changes = {}
    41         self.changes = {}