comparison hgext/convert/__init__.py @ 5521:03496d4fa509

convert: display all errors if we couldn't open the source repo This should give the user a better hint of what's going wrong. Improve some error messages. In particular, mention "CVS checkout" instead of "CVS repo". Fixes issue822 and issue826.
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Fri, 09 Nov 2007 20:21:35 -0200
parents 247af577fe29
children 6ffca2bf23da badbefa55972
comparison
equal deleted inserted replaced
5520:cc3af86ab6fe 5521:03496d4fa509
30 sink_converters = [ 30 sink_converters = [
31 ('hg', mercurial_sink), 31 ('hg', mercurial_sink),
32 ] 32 ]
33 33
34 def convertsource(ui, path, type, rev): 34 def convertsource(ui, path, type, rev):
35 exceptions = []
35 for name, source in source_converters: 36 for name, source in source_converters:
36 try: 37 try:
37 if not type or name == type: 38 if not type or name == type:
38 return source(ui, path, rev) 39 return source(ui, path, rev)
39 except NoRepo, inst: 40 except NoRepo, inst:
40 ui.note(_("convert: %s\n") % inst) 41 exceptions.append(inst)
42 if not ui.quiet:
43 for inst in exceptions:
44 ui.write(_("%s\n") % inst)
41 raise util.Abort('%s: unknown repository type' % path) 45 raise util.Abort('%s: unknown repository type' % path)
42 46
43 def convertsink(ui, path, type): 47 def convertsink(ui, path, type):
44 for name, sink in sink_converters: 48 for name, sink in sink_converters:
45 try: 49 try: