Mercurial > hg
comparison hgext/convert/convcmd.py @ 6332:950e72fc7cf3
convert: allow missing tools not to stop source type detection
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Thu, 20 Mar 2008 23:32:43 +0100 |
parents | 2f9de4aaea9e |
children | c9b8d2565b92 |
comparison
equal
deleted
inserted
replaced
6331:627665e37bdd | 6332:950e72fc7cf3 |
---|---|
3 # Copyright 2005-2007 Matt Mackall <mpm@selenic.com> | 3 # Copyright 2005-2007 Matt Mackall <mpm@selenic.com> |
4 # | 4 # |
5 # This software may be used and distributed according to the terms | 5 # This software may be used and distributed according to the terms |
6 # of the GNU General Public License, incorporated herein by reference. | 6 # of the GNU General Public License, incorporated herein by reference. |
7 | 7 |
8 from common import NoRepo, SKIPREV, mapfile | 8 from common import NoRepo, MissingTool, SKIPREV, mapfile |
9 from cvs import convert_cvs | 9 from cvs import convert_cvs |
10 from darcs import darcs_source | 10 from darcs import darcs_source |
11 from git import convert_git | 11 from git import convert_git |
12 from hg import mercurial_source, mercurial_sink | 12 from hg import mercurial_source, mercurial_sink |
13 from subversion import debugsvnlog, svn_source, svn_sink | 13 from subversion import debugsvnlog, svn_source, svn_sink |
46 exceptions = [] | 46 exceptions = [] |
47 for name, source in source_converters: | 47 for name, source in source_converters: |
48 try: | 48 try: |
49 if not type or name == type: | 49 if not type or name == type: |
50 return source(ui, path, rev) | 50 return source(ui, path, rev) |
51 except NoRepo, inst: | 51 except (NoRepo, MissingTool), inst: |
52 exceptions.append(inst) | 52 exceptions.append(inst) |
53 if not ui.quiet: | 53 if not ui.quiet: |
54 for inst in exceptions: | 54 for inst in exceptions: |
55 ui.write(_("%s\n") % inst) | 55 ui.write(_("%s\n") % inst) |
56 raise util.Abort('%s: unknown repository type' % path) | 56 raise util.Abort('%s: unknown repository type' % path) |