Search code examples
mercurialportable-executablejavahg

javaHG with hg.exe not set as an environmental variable


I am using javaHg on our company's web-application.

I want to avoid installing mercurial when I setup the new release on our server. Do I need to go into details as to why management doesn't want "external" applications installed on the server?

I have a windows portable mercurial in a sub-directory. Is it possible to "point" javaHg to that hg.exe, rather than setting the directory path as an environmental viariable? There must be no tweaking and setups when employing the new release.


Solution

  • Yes, you don't need to set PATH for this. There is a RepositoryConfiguration class that you should use, see the setHgBin method. You pass the configuration object to the Repository object when you create it and it will then use the configured Mercurial binary to start the command server.