##// END OF EJS Templates
convert: display all errors if we couldn't open the source repo...
Alexis S. L. Carvalho -
r5521:03496d4f default
parent child Browse files
Show More
@@ -32,12 +32,16 b' sink_converters = ['
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):
@@ -11,7 +11,7 b' class convert_cvs(converter_source):'
11
11
12 cvs = os.path.join(path, "CVS")
12 cvs = os.path.join(path, "CVS")
13 if not os.path.exists(cvs):
13 if not os.path.exists(cvs):
14 raise NoRepo("couldn't open CVS repo %s" % path)
14 raise NoRepo("%s does not look like a CVS checkout" % path)
15
15
16 self.changeset = {}
16 self.changeset = {}
17 self.files = {}
17 self.files = {}
@@ -24,13 +24,13 b' class darcs_source(converter_source):'
24 # check for _darcs, ElementTree, _darcs/inventory so that we can
24 # check for _darcs, ElementTree, _darcs/inventory so that we can
25 # easily skip test-convert-darcs if ElementTree is not around
25 # easily skip test-convert-darcs if ElementTree is not around
26 if not os.path.exists(os.path.join(path, '_darcs')):
26 if not os.path.exists(os.path.join(path, '_darcs')):
27 raise NoRepo("couldn't open darcs repo %s" % path)
27 raise NoRepo("%s does not look like a darcs repo" % path)
28
28
29 if ElementTree is None:
29 if ElementTree is None:
30 raise util.Abort(_("Python ElementTree module is not available"))
30 raise util.Abort(_("Python ElementTree module is not available"))
31
31
32 if not os.path.exists(os.path.join(path, '_darcs', 'inventory')):
32 if not os.path.exists(os.path.join(path, '_darcs', 'inventory')):
33 raise NoRepo("couldn't open darcs repo %s" % path)
33 raise NoRepo("%s does not look like a darcs repo" % path)
34
34
35 self.path = os.path.realpath(path)
35 self.path = os.path.realpath(path)
36
36
@@ -30,7 +30,7 b' class convert_git(converter_source):'
30 if os.path.isdir(path + "/.git"):
30 if os.path.isdir(path + "/.git"):
31 path += "/.git"
31 path += "/.git"
32 if not os.path.exists(path + "/objects"):
32 if not os.path.exists(path + "/objects"):
33 raise NoRepo("couldn't open GIT repo %s" % path)
33 raise NoRepo("%s does not look like a Git repo" % path)
34 self.path = path
34 self.path = path
35
35
36 def getheads(self):
36 def getheads(self):
@@ -190,7 +190,7 b' class mercurial_source(converter_source)'
190 self.repo.heads()
190 self.repo.heads()
191 except hg.RepoError:
191 except hg.RepoError:
192 ui.print_exc()
192 ui.print_exc()
193 raise NoRepo("could not open hg repo %s as source" % path)
193 raise NoRepo("%s does not look like a Mercurial repo" % path)
194 self.lastrev = None
194 self.lastrev = None
195 self.lastctx = None
195 self.lastctx = None
196 self._changescache = None
196 self._changescache = None
@@ -102,7 +102,7 b' class svn_source(converter_source):'
102 try:
102 try:
103 SubversionException
103 SubversionException
104 except NameError:
104 except NameError:
105 raise NoRepo('subversion python bindings could not be loaded')
105 raise NoRepo('Subversion python bindings could not be loaded')
106
106
107 self.encoding = locale.getpreferredencoding()
107 self.encoding = locale.getpreferredencoding()
108 self.lastrevs = {}
108 self.lastrevs = {}
@@ -131,7 +131,7 b' class svn_source(converter_source):'
131 self.uuid = svn.ra.get_uuid(self.ra).decode(self.encoding)
131 self.uuid = svn.ra.get_uuid(self.ra).decode(self.encoding)
132 except SubversionException, e:
132 except SubversionException, e:
133 ui.print_exc()
133 ui.print_exc()
134 raise NoRepo("couldn't open SVN repo %s" % self.url)
134 raise NoRepo("%s does not look like a Subversion repo" % self.url)
135
135
136 if rev:
136 if rev:
137 try:
137 try:
General Comments 0
You need to be logged in to leave comments. Login now