Search code examples
mercurialteamcityagent

Getting Cannot find mercurial executable at path 'hg'


I am using VCS checkout mode to agent side and also have defined the teamcity.hg.agent.path = c:\program files\mercurial\hg.exe in agent.properties file. Still VCS is not picking up this setting and giving me the following error:-

Test connection failed in Dev :: Stocks :: Build and Package. Cannot find mercurial executable at path 'hg'

Also have defined the path in windows environment variables. Mercurial is not installed on server machine. I have read in documentation that if you are using a agent side checkout then not required. Please guide what I am missing here. thanks


Solution

  • According to the documentation, if you're using server side checkout, then you don't need to install mercurial on your agent.

    But when you set up version control as a VCS root, you do need the TeamCity server to be able to talk to the mercurial server so it can do things like detect changes. The JetBrains documentation specifically says that if you're using a Mercurial VCS root:

    Mercurial should be installed in the server machine, and, if agent-side checkout is used, on the agents.