comparison hgext/convert/hg.py @ 5433:4d34f8b12a9e

convert: report errors more meaningfully if run with --traceback
author Bryan O'Sullivan <bos@serpentine.com>
date Wed, 10 Oct 2007 00:15:33 -0700
parents ad0b580cad35
children d0c67b52ac01
comparison
equal deleted inserted replaced
5432:0d154bce2341 5433:4d34f8b12a9e
172 class mercurial_source(converter_source): 172 class mercurial_source(converter_source):
173 def __init__(self, ui, path, rev=None): 173 def __init__(self, ui, path, rev=None):
174 converter_source.__init__(self, ui, path, rev) 174 converter_source.__init__(self, ui, path, rev)
175 try: 175 try:
176 self.repo = hg.repository(self.ui, path) 176 self.repo = hg.repository(self.ui, path)
177 except: 177 # try to provoke an exception if this isn't really a hg
178 # repo, but some other bogus compatible-looking url
179 self.repo.heads()
180 except hg.RepoError:
181 ui.print_exc()
178 raise NoRepo("could not open hg repo %s as source" % path) 182 raise NoRepo("could not open hg repo %s as source" % path)
179 self.lastrev = None 183 self.lastrev = None
180 self.lastctx = None 184 self.lastctx = None
181 self._changescache = None 185 self._changescache = None
182 186