diff -r 1b5b98837bb5 -r 62019c4427e3 mercurial/util.py --- a/mercurial/util.py Sun May 27 13:50:59 2007 -0700 +++ b/mercurial/util.py Sun May 27 14:26:54 2007 -0700 @@ -1087,6 +1087,18 @@ return p_name return default +def find_exe(name, default=None): + '''find path of an executable. + if name contains a path component, return it as is. otherwise, + use normal executable search path.''' + + if os.sep in name: + # don't check the executable bit. if the file isn't + # executable, whoever tries to actually run it will give a + # much more useful error message. + return name + return find_in_path(name, os.environ.get('PATH', ''), default=default) + def _buildencodefun(): e = '_' win_reserved = [ord(x) for x in '\\:*?"<>|']