Clone wiki

Mercurial LabVIEW project integration / Home



This tool allows you to directly connect to Mercurial repositories from within the LabVIEW project interface.

Table of Contents:


The tool is distributed as a VIP package, installation should be done with VIPM.


If you upgrade the tool to a higher version, you should restart LabVIEW after the install to allow the new VIs to be loaded into the Source Control framework (enabling and disabling of source control is not enough).


Since the tool uses the LabVIEW supplied Source Control interface, you'll need to have LabVIEW Professional installed (see the LabVIEW about screen for the actual version you have installed). LabVIEW 2011 and higher are supported.

The tool is dependend on the following packages (actual versions are controlled by the install package):

  • Mercurial API 1.2.0
  • jki_lib_state_machine
  • oglib_appcontrol
  • oglib_array
  • oglib_comparison
  • oglib_error
  • oglib_file
  • oglib_lvdata
  • oglib_string


After installation you need to activate the Mercurial interface in LabVIEW, select this from the options Source Control page:

LabVIEW Source Control Configuration dialog
The details of the non-Mercurial specific options are documented in the LabVIEW help. The various checkout options (checkout callers, prompts etc.) are not usefull for a distributed VCS like Mercurial After selecting Mercurial as the SCC provider type, the Project SCC Options dialog will apear, the same dialog can be openend by using the Advanced... button on the LabVIEW Options Source Control dialog.

Mercurial Project SCC Options dialog


The following options are available in the configuration dialog.

Exclude user.lib

This will prevent items in your user.lib folder to be added to a Mercurial repository, disable this if you have Mercurial repositories in your user.lib folder. Default is true

Update LabVIEW project

This will update the icons of the LabVIEW project with the actual status of the file in the Mercurial repository:

LabVIEW project showing the different statusses

Disabling this speeds up the interaction with Mercurial (statusses are not requested) and might be usefull for large projects. Default is true

Show command line response

This option is currently disabled, but in future releases it will show a seperate dialog with the interaction with Mercurial

Issue tracker support?

This option adds extra input fields in the commit dialog. Default is false

Issue resolved

This option allows you to add a standard message if an issue is marked as resolved, use %s to insert the issue identifier. This option is only available if Issue tracker support? is enabled, the default value is Fixes issue %s.

Issue Mention

This option allows you to add a standard message if an issue is marked in the commit dialog, use %s to insert the issue identifier. This option is only available if Issue tracker support? is enabled, the default value is Issue %s.

Mercurial GUI command

This option allows you to insert a command to run when you request the GUI tool to be shown from within LabVIEW, the dropdown has already the Tortoise HG Workbench (thg) available.

For storing your settings in a separate file, you can use the File->Import... and File->Export... functions.

Project integration

After you've configured the default project settings, LabVIEW will request the status for all files in the project environment and update the icon overlays. You can update the status of a file from within the project environment using the context menu or menu-bar.

Commiting changes

If you want to commit your changes to Mercurial, you execute the Check In command in LabVIEW, this can be accessed in 3 methods:

  • Right click on the item in the LabVIEW Project (works on multiple files as well), select Check In...
  • In the window of the item (VI, control, project, class,library) you want to commit, go to the following menu item: Tools\Source Control\Check In...
  • Using the Source Control toolbar button: Check-In.png
    The following dialog pops up, forcing you to add a commit message.
    Check In dialog

LabVIEW is not pro-actively monitoring the status of the files. If you think that the status is not correct (for instance after an edit and save action), you can force LabVIEW to update the status by using the menu option Tools\Source Control\Refresh Status.

Adding files

If have selected the option Prompt to add files to source control when adding files to project LabVIEW will show a dialog asking you if you want to add files to Mercurial.
Prompts detail of SCC options
If you want to add files later you have three options:

  • Using the context menu of the project
  • Using the menu bar of the window of that object
  • Using the Source Control toolbar button Add.png

Pushing changesets

If you want to push your changes to a remote Mercurial repository, you open the Check in dialog and use the Advanced... button.
Check in dialog Advanced highlighted
The following dialog appears.
Advanced Commit Dialog, Push options highlighted
You can activate the Push checkmark, and select a repository (standard is default), close the Check In Advanced dialog, and Check In dialog. LabVIEW will commit and push the current changeset(s). If the push creates a new remote head, the push will fail.

Tagging changeset

If you want to tag during a commit action, you can use the Advanced dialog and add a tag, the dialog will have previous tags available for reuse/alteration.
Advanced Commit Dialog, Tag options highlighted

Launching Mercurial client

You can launch a Mercurial client by using the menu option Tools\Source Control\Run Mercurial Client...

Issue tracker integration

If you have an issue tracker and wish to add a special commit message referring issues (bugs, features, release etc.) you can enable the Issue tracker integration in the configuration dialog.

To add an issue reference you open the advanced check-in dialog and enter the details of the issue in the following fields: AC-Issue.png
Advanced Close dialog, Issue references highlighted If you add a reference ID the fixed field will become available.

By inserting a reference ID the commit message will be prepended with the message specified in the configuration dialog. The %s specifier will be replaced by the string in the Issue ID field.

Consult your Issue/Source Control manager to get the details of the message you will need to connect a checkin to an issue.


Committing, pushing and Issue integration

Have a look at this video to see a workflow that shows project and Issue integration: video

Creating a repository

If LabVIEW requests the status of an project file (.lvproj) that is not inside a Mercurial repository, the tool will ask if it needs to create a repository and add all the files in that directory:

Known Issues

  • After closing LabVIEW an error pops up stating that an access violation.

LabVIEWCrashReporter.png Crash reporter dialog

  • On large projects opening can take a long time with several dialogs stating 'Error -2908 occured at' (issue ID 112)

KI-112.png Proxy caller error