hgext/convert/common.py
changeset 5497 f0a3918abd42
parent 5441 71e7c86adcb7
child 5510 11d7908a3ea8
--- a/hgext/convert/common.py	Sun Oct 28 09:47:54 2007 +0100
+++ b/hgext/convert/common.py	Tue Oct 30 22:14:15 2007 +0100
@@ -1,6 +1,7 @@
 # common code for the convert extension
 import base64
 import cPickle as pickle
+from mercurial import util
 
 def encodeargs(args):
     def encodearg(s):
@@ -15,6 +16,11 @@
     s = base64.decodestring(s)
     return pickle.loads(s)
 
+def checktool(exe, name=None):
+    name = name or exe
+    if not util.find_exe(exe):
+        raise util.Abort('cannot find required "%s" tool' % name)
+
 class NoRepo(Exception): pass
 
 SKIPREV = 'SKIP'