TeamCity
 
You are viewing the documentation for an earlier version of TeamCity.

Mercurial

Last modified: 20 April 2023

TeamCity uses the typical Mercurial command line client: hg command. Mercurial 1.5.2+ is supported.

Note that:

  • Remote Run from IDE is not supported. Please use Branch Remote Run Trigger instead.

  • Checkout rules for agent-side checkout are not supported except for the .=><target_dir> rule.

For common VCS Root properties, see this section. The section below contains the description of Mercurial-specific fields and options.

TeamCity supports Mercurial out of the box.

General Settings



Path to hg executable detection



When an agent starts, the hg-plugin detects Mercurial installed on the agent machine.

The plugin tries to run the hg version command using the path specified by teamcity.hg.agent.path parameter. You can change this parameter in < >\conf\buildAgent.properties.

If this parameter is not set, the plugin uses hg as a path to the command, assuming it is somewhere in the $PATH. If the command is executed successfully and mercurial has an appropriate version (1.5.2+), then the hg-plugin reports the path to hg in the teamcity.hg.agent.path parameter.

During the build, the plugin uses the hg specified in the HG command path field of a VCS root settings. To use the detected hg, put %\teamcity.hg.agent.path% in this field. Configurations with such settings will be run only on agents which report the path to hg.

Since TeamCity 2017.2.2, the server side of the plugin checks the value of the teamcity.hg.customServerHgPathWhitelist internal property. The property contains the ;-separated list of allowed hg paths to use on the server. If the path specified in VCS root is in whitelist, then it is used on the server. If not, the path specified in the teamcity.hg.server.path internal property is used. If this property is not set, TeamCity server uses hg from the $PATH.

Agent Settings



These are the settings used in case of the agent-side checkout (default mode since TeamCity 10.0), which requires Mercurial installed on all agents.

Internal Properties



This section describes hg-related internal properties. You can modify the defaults to adjust the Mercurial settings as needed.

Server-side internal properties:

Agent configuration for Mercurial: