LabVIEW Development Best Practices Blog

Community Browser
cancel
Showing results for 
Search instead for 
Did you mean: 

Re: Integrate Graphical Diff with Subversion Source Code Control

Elijah_K
Active Participant

This continues to be a constant question from customers, so I just want to make sure everyone is aware that you can configure Subversion (or any source code control tool) to automatically call LabVIEW graphical differencing tool (only in LabVIEW Professional). 

To setup, simply enter the following command line into the settings dialog of TortoiseSVN for a .vi file:

"C:\Program Files\National Instruments\Shared\LabVIEW Compare\LVCompare.exe" %mine %base -nobdcosm -nobdpos

For more details on how to set this up and what the command line parameters mean, download this guide to software engineering.  Once you've set this up, using it is a breeze, and you'll find you can't live without it.  You can use it simply by right-cliking on a modified file, and selecting 'Diff' (or 'Diff with Previous')

3-16-2011 12-52-58 AM.png

And the result:

3-16-2011 12-56-34 AM.png

I'm always looking for feedback about this utility.  What would you improve?  What do you or don't you like about this feature?  How often do you use it?  Do you have any need or interest in the ability to export or save the results of this comparison?  Thank you in advance for your comments!

Eli

Elijah Kerry
NI Director, Software Community
Comments
LuI
Active Participant
Active Participant

Elijah,

thank you for documenting this setting. It is important to have the graphical diff, just in case. But, to be honest, I rarely use it.

Having rather large apps in a regulated environment (medical devices producer), the graphical diff is usefull only to LV devellopers. But we have to support auditors and follow the regulation on SW devellopment, where we have to document the changes between different versions in a rather abstract way; at least _also_ in plain english words. So we rely in documentations, VI history, SVN tags and external documentation.

If, however, we could get the ability to export the diff results in a way to get it into documentation, that would be quite usefull.

Greetings from Germany!

--

Uwe

LeifS
Member

Hi,

I find the LVCompare.exe really nice and I use it several times a day. I'd also like to mention "the other" similar utility LVMerge.exe which I use for resolving conflicts. My command line in TortoiseSVN for that one is:

"C:\Program Files\National Instruments\Shared\LabVIEW Merge\LVMerge.exe" %base %theirs %mine %merged

One annoying thing is that when I close a changed a VI and LV asks if it should be saved, I cant get a graphical diff from there!

I have to save it first and then invoke LVCompare to see what has changed.

It would also be nice to be able to export the list of changes somehow, maybe selectable as either a ascii file (but how can we describe graphical differences in text in a meaningful way?) or a directory of PNG-files (snippets?) with the red-ring annotation visible.

/Leif

danny_t
Active Participant

Hi

We use LVCompare all the time, it is a basic part of our peer review process.

We use it with ClearCase source control rather than SubVersion and I have generated a LabVIEW wiki entry to show people how to do this. http://labviewwiki.org/IBM_Rational_ClearCase

I like the idea above to be able to export diff results in some textual form for history purposes.

My biggest wish for the LVCompare tool is describe below -

When you launch the compare tool from the tools menu you are offered the option of what to compare as a tick box for example, VI attriabutes or Front panel position / size. I think you can set this when setting up your command line to autolauch the Diff tool. However  I would really like this to be availabe as something to change from the "Differences" box after you have auto lauched it and then a button to re-run the compare with the new settings. At the present time there is no easy way to change the setting of what you diff when using the tool in this integrated mode

cheers

Danny

I have added the following to the idea exchange to cover this suggestion

http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Add-functionallity-to-the-LVCompare-quot-Differences-q...

Danny Thomson AshVire Ltd
soupy
Member

It is a good basic utility, but I would like to see some power user featrues added. Sometimes, i don't care about cosmetic changes. It would be nice to have the ability to filter results by type (cosmetic change, typedef update, addition, deletion, etc.). I'm a keyboard shortcut junkey, it would be nice to have a keyboard shortcut to go to the next/previous difference with a key press. i suggest using Ctrl-G / Ctrl-Shift-G to go next/previous (just like the Find function in the dev environment).

shew82
Member

I'm also in the "some more settings could be useful camp" it would be really good to be able to quickly and easily filter certain categories of changes.... an entry in the Options dialog for default options would also be useful.

I have also been wary of using this with VIs that are part of libraries... how does the diff'ing cope with library member VIs.. after all the %mine% and %theirs% VI file names may not be in the library - would this lead to problems where the VI claims to be a member of the library and the library denies it?

My only other thing is that I would love a way to easily set up these tools with common SCM providers (especially those NOT supported by the Microsoft standard ) I have managed to write some registry scripts for TortoiseSVN in the past but maybe some handy "setup" buttons in the options screen I mentioned at the start of this would be nice!

Elijah_K
Active Participant

Anyone using Mecurial yet?  I'd be interested to know how well the integration works, which is well documented here: http://labviewwiki.org/Hg

Elijah Kerry
NI Director, Software Community
CharlesB64
Member

I am pretty satisfied with diffing VIs (using it with Git).

What would be great would be a utility to say VIs got only cosmetic modifications. It would be run before a commit (called from a pre-commit hook) and issue a warning or ask for confirmation. I may be fussy but I don't like having commits with VIs that got only cosmetic changes.

David S.
NI Employee (retired)

Charles864 -

What would constitute a "cosmetic modification"? Is that an absolute definition, or a subjective one? I'm inclined to think it's going to be the latter. I agree that some pre-commit and post-commit hooks would be very nice, though.

David Staab, CLA
Staff Systems Engineer
National Instruments
CharlesB64
Member

A cosmetic modification is moving stuff on the block diagram; LVCompare allows you already to ignore such diffs in command-line arguments (see manual)

David S.
NI Employee (retired)

Your link goes to an "Error - Not Found" page.

David Staab, CLA
Staff Systems Engineer
National Instruments
CharlesB64
Member

Sorry it is http://zone.ni.com/reference/en-XX/help/371361G-01/lvhowto/configlvcomp_thirdparty/

Le 28 mars 2011 à 17:59, DavidS. a écrit :

Community

Integrate Graphical Diff with Subversion Source Code Control: Request for Feedback

new comment by DavidS. - View all comments on this blog post

Your link goes to an "Error - Not Found" page.

Reply to this email to respond to DavidS.'s comment.

onnodb
Member

Thanks for this post! I use LVCompare a lot — it's really an essential tool if you want to use source control productively.

There are some things that make diffing in LabVIEW a bit more painful than in text-based languages. I'm not sure it's at all possible to solve these issues, but here they are anyway:

  • Quite often, I find myself diffing two revisions of a VI that depends on a lot of subVIs. If you double-click on a file in the TortoiseSVN revision log, it stores one or both of the revisions in your temp directory, which means that all its dependencies are broken. Running LVCompare then means that you have to spend a minute clicking on lots of "Ignore" buttons when LV asks you to locate dependencies. As you can probably imagine, this can be rather annoying after a while.
  • As other people have mentioned, it would be nice if it'd be really easy to toggle various filters. It's great that you can filter by using command-line arguments, but you don't want to change TortoiseSVN's settings each and every time you'd like to use a different filter.
  • Keyboard shortcuts for going to the next/previous diff would be great!
  • I think that "Differences" dialog could be better. It's not easy to get a direct overview of what's changed right now. Also, I don't have LV at hand right now, but I'm not sure it's resizeable, for example.(Please correct me if I'm wrong).

That's all for now, but I'll have another look on Monday, when I have access to LV again.

Great to hear you're looking to improve this part of LV!

Science & Wires — a blog on LabVIEW and scientific programming
http://scienceandwires.com
LeifS
Member

Tto partly fix the first thing with broken paths, I'd suggest that you try to add your source code top directories into the "LabVIEW VI search paths". (Add them like foo\* to include the subdirs)

This reduces the "Ignore" clicks, but the load time will still be quite long.

The best solution probably would be that a VI doesn't store the path (neither absolute nor relative) in the VI, but instead relied on the information in .lvproj to find a subVI.

rolfk
Knight of NI

The problem with this is that a VI can work without project, and for backwards compatibility should continue to work that way.

Rolf Kalbermatter
My Blog
Elijah_K
Active Participant

Also, make sure that the first VI you point the tool to is the one that's

already open in memory.  If I set Subversion up with '%base' first, I have

to click through multiple 'Ignores.'  As a result, I changed the order in

my configuration so that %mine is first, and now I never see the dialog

(assuming that %mine) is the current revision I have open in LabVIEW.

Elijah Kerry
NI Director, Software Community
Arun_Persaud
Member

I'm using git for source code control, but can't use LVMerge and LVcompare, since I only have the "Full" labview version... would love to be able to integrate this with git to be able to use git not just for syncing across several computer and backup, but also for branching and merging. It would also be great, if one could create png from the diff and use this with cgit or gitweb to be able to browse the history or new changes in the browser (perhaps this is already possible, but I can't test). For this a standalone linux diff would be great, so I can run it with cgit and for example apache on my webserver.

Arun

JChristensen
Member

Anyone using ClearCase for SCM?

We are using ClearCase for version control and I have modified the "map" file to call LVCompare from ClearCase.

However, I get an Error from LVCompare 2009.

Error Occurred while running LVCompare. Open VI Reference in LVCompare.vi<APPEND> VI Path: <b>M:\Production\Common\Utility\RFSG 3 Gen Control.vi@@\main\TestBench_VOB\0<b>

This was error created by using ClearCase Explorer and right click and select the file name and select "Compare with Previous"

The file name "path\filename@@\main\TestBench_VOB\0"  is how ClearCase defines the different version file name.

Is there a way to debug what parameters values are being passed into LVCompare to debug the settings?

ClearCase does not require individual parameters for the file paths in the map file. Just point XCompare to the alternate Diff Utility

We switched last year from Perforce to ClearCase due to the hackers hole in Perforce found by Google. So we have to use ClearCase.

danny_t
Active Participant

Hi Christenson,

I have been out last week or I would have replied sooner.  We use ClearCase currently running LabVIEW 2010 with ClearCase & LAbVIEW 8.2.1.

Which entry in the map file did you change ? andf do you have LabVIEW files ie *.VI setup as anything special in the magic file ?

I posted this help guide on the LabVIEW Wikki http://labviewwiki.org/IBM_Rational_ClearCase and some other stuff here  http://lavag.org/topic/13521-guide-to-using-lvcompare-with-clearcase/  including a small VI to use as a wrapper and allow you to chose what level of Diff you want.

As an ex ClearCase administrator if you are still having problem feel free to email me and I will see if I can help.

Note the tip above about making sure it is best to have the file you are doing the compare from open in memory

regards

Danny

Danny Thomson AshVire Ltd
Bob_Schor
Knight of NI

I've just had a "big fight" with LVCompare, trying to "force" it to help me sort through two versions of a large LV "project" (in LabVIEW 7.0, way before "Project" was available).  I wanted to know which of about 900 VIs was "substantially different".  LVCompare could, in principle, tell me (using the proper switches).  I was prepared to write the "wrapper" utility (make a list of all the file paths in the two versions, filter out the files that are unique, and pair-wise present the remaining to LVCompare, one at a time).  The problem was there was (a) no way to turn off the graphical output (didn't want to eyeball 900 results!) and (b) no way to "capture" whether the compare showed a difference or not.

But someone posted on the Forum a mysterious Invoke Node that seemed to call LVCompare, with both an "Interactive?" control and a "Same?" indicator, just what I needed.  This, in fact, does a marvelous job (with a few caveats) -- I now know which 60 VIs I need to examine closely.  Indeed, I made a second utility that lets me specify the root folders and one "common" file -- it finds the pairs of files and presents them to LVCompare in Interactive mode (specifically so I can "see" the differences).  One problem with LVCompare is that the two files need to have different file names, so I do the renaming and un-renaming of one of the files in my wrapper routine.

I've made a suggestion on the Idea Exchange to make the Invoke Node "available" so users could be "more creative" with the Compare tool.

Bob Schor

David S.
NI Employee (retired)

Hi Bob -

Considering the competitiveness of the Idea Exchange and the pace at which ideas are implemented in practice, why not just post how to get to the node now? Or share the forum thread where it's discussed?

David Staab, CLA
Staff Systems Engineer
National Instruments
Bob_Schor
Knight of NI

Good idea.  To avoid cross-posting, I've put a snippet containing the node (and a brief "how-to" on the Ideas Exchange page where I made the suggestion to make this node "visible".  Sorry I don't know how to make a link to it, but if you search "LVCompare", you should find the string ...

Bob Schor

SuperS_5
Member

I wish the some of the source was available.  I started to use LVMerge a lot, but, we found that every now and then some event structures became disconnected with their events. The VI wasn't broke, but also never fired the event until it was recreated.  This was really, really hard to track down. 

LVMerge seemed to handle grouping of differences better, has filtering, and handles 3 VIs at a time. (Repository, Working Copy, Base.)  The major problems were the disconnecting the event structures, and errors while loading.  Complex VIs seldom load in LVMerge.

LVCompare seemed to error less often when loading VIs, but does a much poorer job at comparing.

These problems have forced us to stop using both utilities.  If the source was available to the community, we could at least submit fixes.