Okay, in that case definitely look at the commits I linked. ML does shell commands in various places that explicitly call hg CLI commands. It is not possible to automatically convert it, the problem isn't the repo using git or hg, the problem is ML build system tries to use hg tools, and expects hg related directories to exist. You must modify the build system if you want to manage ML code using git.
The commits I link to make those changes.