Integration With Mercurial

Applies to TestComplete 15.31, last modified on March 17, 2022

Mercurial (Hg) is a free software version control system by Selenic. You can use Mercurial to store and manage your TestComplete test projects and project suites. You can work with local repositories (located on your machine), as well as with remote repositories (located in a network).

About Mercurial integration

You can integrate TestComplete with Mercurial and work with repositories directly from the TestComplete user interface. Without leaving the TestComplete IDE, you can add test projects and their child items to the repository, commit changes, pull changes from and push them to repositories, and so on.

TestComplete includes special built-in dialogs that simplify performing various commands on files and repositories, such as viewing the file history, creating and merging branches, and so on.

Requirements

Before you start working with Mercurial from TestComplete, you need to prepare your computer and prepare TestComplete:

  • Install Mercurial for Windows on your computer. To work with the Mercurial source control system, TestComplete uses the Mercurial command-line utility (hg.exe).

  • Check whether the TestComplete Mercurial Plugin is enabled (TestComplete installs and enables that plugin automatically during the installation). The plugin provides menu commands, dialogs and wizards to work with Mercurial.

  • Switch the TestComplete current source control provider to Mercurial Plugin and enter a valid path to hg.exe in the Source Control Options dialog.

For complete information on how to enable Mercurial integration in TestComplete, see Requirements and Prerequisites.

Working with Mercurial

To work with the source control, you can use the following UI elements in TestComplete:

– or –

  • Items of the File > Source Control menu of TestComplete.

– or –

  • Items of the Source Control toolbar.

    Using the toolbar is, perhaps, the most convenient way to work with Mercurial repositories. By default, the toolbar is hidden. To make it visible, right-click the main menu area and select Source Control from the subsequent context menu. See also Customizing Toolbars and Menus.

Source Control menu and Source Control toolbar with Mercurial integration enabled.
Source Control menu and Source Control toolbar with Mercurial integration enabled.

These menus and the toolbar hold the same items.

Note: The context menu of some items in the Project Explorer does not include the Source Control submenu. This means that the item is not stored in a file. Add it to the source control as part of its parent item.

Integration with Mercurial adds the following commands to the Source Control menus and toolbar:

Item Description
Clone Repository Makes a copy of an existing repository storing a project or project suite and opens that project or project suite in TestComplete.
Create Repository Creates a new local repository and adds your project or project suite to that repository.
Delete Repository Unbinds projects from the source control and deletes the repository.
Refresh Status Refreshes the status of items in the source control.
Show Log Opens the history of changes made to the repository.
Commit Submits your latest changes to the repository.
Synchronize Synchronizes changes between your local and remote repositories.
Update Updates your local repository with changes from the remote repository.
Edit Ignore Filter Opens the dialog where you can edit the ignore filter of your repository.

When a project suite or one of its projects is bound to the Mercurial source control, the Project Explorer shows icons indicating the status of project items in the source control:

Status icons in Project Explorer
Status icons in the Project Explorer
Note: When you add new items to your project or edit existing items, TestComplete updates the project items status only when you save the changes you have made. This happens because TestComplete tracks the status of corresponding files, and the file status in the repository updates only when you save the changes. Until the changes are unsaved, the file status is unchanged.

That is why, for example, when you add a new keyword test or script unit to your project, the test or unit is marked as new, but the parent KeywordTests and Script items are not marked as modified until you save the changes.

Integration with TortoiseHg client

You can enhance your interaction with Mercurial by enabling integration between TestComplete and TortoiseHg - a GUI client for Windows. In this case, TestComplete will use TortoiseHg dialogs to perform some of source control operations. This gives you even more abilities to work with Mercurial:

Items of the Source Control menu with TortoiseHg integration enabled.
Items of the Source Control menu with TortoiseHg integration enabled.

Integration with the TortoiseHg client is the preferred way to work with Mercurial from TestComplete IDE. To learn more about TestComplete integration with TortoiseHg and the way to configure the integration, see Working With TortoiseHg Client.

Common tasks

Known issues and limitations

  • TestComplete does not support non-Latin characters in names of branches, tags, commit messages and other text labels. Working with branches, tags and commit messages that contain non-Latin characters may cause errors. As a workaround, we recommend that you enable integration with the TortoiseHg client. The dialogs of TortoiseHg have full support for non-Latin characters.

  • TestComplete script files can have the ANSI, multibyte (UTF-8) or Unicode (UTF-16) format. The native Mercurial client does not support Unicode files and treats them as binary files. This may hamper the comparison and merging of script files in the Unicode format. To resolve the problem, you can do either of the following:

    • Change the character encoding format of script units in your project to UTF-8 or ANSI. For more information on this, see Units Encoding.

    • Use the TortoiseHg client. This client supports Unicode files and treats them as text files.

  • Storing a large number of Test Visualizer images in a source control system is not recommended as this can reduce performance of the check in and check out operations on the test project. To avoid performance issues, remove unnecessary Visualizer images from your source control-bound test project. You can also disable the Bind Visualizer frames to SCC option to command TestComplete not to add (and check in) Visualizer files to the source control. For details, see the Visualizer Data and Source Control Systems section of the Sharing Visualizer Frames topic.

See Also

Integration With Source Control Systems
Integration With Source Control Systems via SCC API Providers (Legacy)

Highlight search results