I found this question because I was having a similar problem with my vscode + mercurial extension.
My windows is setup as a portable install and mercurial is in one of my conda environments so hg.exe was not found automatically by the extension. I set hg.path = [path to hg.exe"]
in my case this line as added to my user settings json file (File->Preferences->Settings, then search for git.path and click Edit in setttings.json):
"hg.path": "C:\Users\myname\anaconda3\envs\py27merc\Scripts\hg.exe"
An equivalent path on the path might be something like "/usr/local/bin/hg"
depending how mercurial is installed on your system
git has a similar variable and if you have git installed in fashion so that it cannot be found automatically you might need to set it manually in a similar way like:
"git.path": "/usr/local/bin/git"
assuming that /usr/local/bin/git is where your git executable is located