diff --git a/hgext/convert/common.py b/hgext/convert/common.py --- a/hgext/convert/common.py +++ b/hgext/convert/common.py @@ -18,10 +18,13 @@ def decodeargs(s): s = base64.decodestring(s) return pickle.loads(s) -def checktool(exe, name=None): +class MissingTool(Exception): pass + +def checktool(exe, name=None, abort=True): name = name or exe if not util.find_exe(exe): - raise util.Abort('cannot find required "%s" tool' % name) + exc = abort and util.Abort or MissingTool + raise exc(_('cannot find required "%s" tool') % name) class NoRepo(Exception): pass diff --git a/hgext/convert/convcmd.py b/hgext/convert/convcmd.py --- a/hgext/convert/convcmd.py +++ b/hgext/convert/convcmd.py @@ -5,7 +5,7 @@ # This software may be used and distributed according to the terms # of the GNU General Public License, incorporated herein by reference. -from common import NoRepo, SKIPREV, mapfile +from common import NoRepo, MissingTool, SKIPREV, mapfile from cvs import convert_cvs from darcs import darcs_source from git import convert_git @@ -48,7 +48,7 @@ def convertsource(ui, path, type, rev): try: if not type or name == type: return source(ui, path, rev) - except NoRepo, inst: + except (NoRepo, MissingTool), inst: exceptions.append(inst) if not ui.quiet: for inst in exceptions: diff --git a/hgext/convert/monotone.py b/hgext/convert/monotone.py --- a/hgext/convert/monotone.py +++ b/hgext/convert/monotone.py @@ -2,7 +2,8 @@ import os, re, time from mercurial import util -from common import NoRepo, commit, converter_source, checktool, commandline +from common import NoRepo, MissingTool, commit, converter_source, checktool +from common import commandline from mercurial.i18n import _ class monotone_source(converter_source, commandline): @@ -41,7 +42,7 @@ class monotone_source(converter_source, if not os.path.exists(path): raise norepo - checktool('mtn') + checktool('mtn', abort=False) # test if there are any revisions self.rev = None