Directory named "hg" on search path is used for cmdserver execution resulting in permission denied error
Created originally on Bitbucket by Peter Duda
On Linux, when there is a directory named “hg” on the search path before real “hg” script, it is found and used as path for mercurial cmdserver execution, resulting in following error reported when there is attempt to use cmdserver:
cmdserver: execve: Permission denied
cmdserver: process exited unexpectedly with code 0
Renaming that directory resolves an issue, but directory should not be used when searching for mercurial exec path.
os.path.isfile(ppath) should be added to os.access(ppath, os.X_OK) test in find_in_path method in Not Windows section in tortoisehg/util/paths.py