Mercurial Integration in the IDE

From RAD Studio
Jump to: navigation, search

Go Up to Version Control Systems in the IDE

The Version Insight feature integrates support for the Mercurial version control system into the IDE.

For more information about Mercurial SCM, see

Features of Mercurial in the IDE

For any file that is managed by Mercurial in the IDE:

  • The History Manager displays both the local file history information and the Mercurial history information. For example, Mercurial comments and history are available on the Information tab of the History Manager.
  • You can compare or diff versions of the file that were created in and are managed by a Mercurial system, even if the file was not created or backed up by the IDE.
  • You can perform common Mercurial commands such as:
    • Commit (Mercurial) (send your local changes to your local repository).
    • Show Log (click the Information tab on the History Manager).
    • Diff (compare two versions of a file).

Mercurial Command Equivalents in RAD Studio

If you are familiar with Mercurial, take a look at this useful table that describes how to perform common Mercurial tasks in the RAD Studio IDE.

Enabling Mercurial in RAD Studio

Mercurial support is not enabled by default. To enable Mercurial in the IDE, use the following steps:

  1. Download and install Mercurial in your system.
  2. In the IDE, go to Tools > Options > Version Control > Mercurial.
  3. Insert the path to the installed Mercurial executable (hg.exe) in your system. For instance, in a Windows system the Hg executable is located in:
    C:\Program Files\Mercurial\hg.exe
  4. Change other parameters as you need.
  5. Click OK to close the wizard.

To implement the Mercurial features, the IDE does not add anything to your project. Instead, the IDE simply uses the Mercurial information that is stored in your local repository.

Mercurial Setup

Once you have installed Mercurial on your system, you need to set your user name and e-mail address. Mercurial uses this information in every commit.

To configure your user name and e-mail address of your Mercurial repository, you need to edit the Mercurial.ini file that is located in your system (C:\Users\<username>\Mercurial.ini).

  1. Open the command line tool.
  2. Type the following command:
    hg config --edit
  3. Add your username and email as detailed in the file:
    # username = Jane Doe <>
    username =
  4. Check your new settings by typing:
    hg config

Update Your Local Repository

To avoid a conflict between versions, always do an update on your local files before you start making changes:

  1. Open the command line tool.
  2. Navigate to the local folder for your Mercurial repository.
  3. Type the following command:
    hg pull
  4. Authenticate in the remote repository if needed.
  5. Update the local directory (the pull command does not update it automatically):
    hg update
NOTE: If you are using the last revision of the files under the version control, you will get the following message: No changes found.

Troubleshooting Using Mercurial

Cannot Retrieve Content from Your Remote Repository

If your remote Mercurial repository needs authentication (it is a private repository), you need to clone the data from the command line. See Clone a Copy of a Repository That Needs Authentication.


Equivalent commands

Repository Actions

Log and History Actions

Difference View Actions

Reverting Changes

Dialog Boxes and Panes

See Also