Blog

Using LVmerge LabVIEW Merge Tool with TortoiseSVN

Using LVmerge LabVIEW Merge Tool with TortoiseSVN

When multiple developers are working on the same LabVIEW project, version control becomes crucial (that's where TortoiseSVN shines). Even with version control software and good developer communication, you'll eventually end up with two conflicting versions of the same VI. In this situation, being able to identify the changes each developer made to the original vi and choosing which modifications to keep is important, but it's tough to do this manually. This is exactly where LVMerge comes in!

The LabVIEW Merge utility provides a way to compare your version of a VI, another developer's conflicting VI, and the base version of the VI and, from these, to create a merged version that incorporates all the desired modifications. It was made available starting in LV8.5 and will work with any LV version after that. To configure it for use under SVN:

  1. Right click on a file to bring up the Tortoise context menu
  2. Find the "settings" entry in the context menu
  3. Tortoise SVN Settings

  4. In the setting dialog there will be a category called "External Programs" under this category is an entry for "Merge Tool"

  5. Click "Advanced" to set up a specific merge command
  6. Add a new entry - extension should be ".vi" and the command is "C:\Program Files\National Instruments\Shared\LabVIEW Merge\LVMerge.exe %base %theirs %mine %merged" (without the quotes)

Actual usage of the Merge is a little more complicated:

  1. When you do a Commit on a file and someone else has already committed a modified version of the same file, you will get an error that your file is out of date and that you need to update your working copy.
  2. Next do an Update and you will get a message about a conflict and the conflicting file will get a special icon (yellow exclamation point).
  3. Right click this file and do an "Edit Conflicts". This will bring up the Merge utility (assuming you did everything above right). Note: when you start the Merge utility, it will try to open up the file with whatever version of LV was most recently running. If you try to perform a Merge on a file saved with a later version of LV than the one that you most recently used, you will get an error stating the file version is newer than the current LV version. To avoid this, just make sure you have the appropriate version of LV running before you start the Merge utility.
  4. Be careful, when you finish your merging and hit "close" it will attempt to save the result of the merge over your working copy. You will lose your working copy forever - which is fine, since the merge should have taken care of creating a replacement that incorporates your working copy changes.
  5. Finally, right click the file and hit "Resolved". Since the merge isn't directly integrated into SVN, it doesn't know that we have resolved the conflict and we have to tell it explicitly. In the Resolve window, do not hit OK, but instead right click on the file and choose "Resolved", and click Yes to confirm. (If you just hit OK then for some reason the normal resolve operation will generally have an error and fail, thus preventing you from committing the merged file).
  6. The merged file will now show up as modified, but should no longer be in a conflicted state. Do a Commit to add your new merged file into the Repo.

For National Instrument's discussion the details of actually using the Labview Merge Tool click here.

Learn more about DMC's LabVIEW programming and J1939 protocol driver expertise.

Comments

David
# David
Thanks, Jesse, a very useful article.
selvakumar
# selvakumar
how to avoid tortoise svn mine error ... please tell ans my email id.

Post a comment

Name (required)

Email (required)

CAPTCHA image
Enter the code shown above: