Posted on
Wednesday 22 August 2007

One of the beautiful things about source code control is having the ability to compare the differences between a file that you’ve modified and the same file before the modifications. If you’re already using TortoiseSVN then you probably know that it has built-in support for comparing the differences of text files. But, did you know that you can configure TortoiseSVN to use other differencing programs depending on the file type (extension)?

And, did you know that there is a great tool called Beyond Compare that (among many other things) can compare the differences between ZIP files? Beyond Compare can look inside of ZIP archives as if they were real folders on your hard disk, allowing you to see the differences of files inside the ZIP archive.

To see this in action, let’s configure TortoiseSVN to use Beyond Compare as the Diff tool for *.zip file types. It’s really easy. First, launch the TortoiseSVN Settings dialog (shown below) by right-clicking on a file or folder and choosing TortoiseSVN>>Settings. On the Diff Viewer page [1], press the Advanced button [2] to open the Advanced diff settings dialog. Then press the Add button [3] and enter “.zip” as the Extension and the path to Beyond Compare (BC2.exe) as the External Program [4].

Now, let’s show the differences of a modified ZIP archive (“My Archive.zip”, in this case) that is in a TortoiseSVN working copy. Note that Beyond Compare is launched and we can not only see what has changed in our zip file, we can actually compare the differences of the individual files inside the ZIP file (as shown below).

Note that many other source code control tools (besides TortoiseSVN) allow you to specify external applications for comparing differences of specific file types. Check with your source code control tool’s documentation for more details.

And finally, if you’re not using Beyond Compare, you should definitely take it for a test drive — it’s got a lot of great features

Subversion and LabVIEW in the Enterprise : If your organization uses LabVIEW and you would like help deploying Subversion in your organization, consider hiring JKI to help get you started. You can contact us via our website.

This may not be the most correct forum for my questions but it seems a lot more active than the lv-diff forum. lv-diff shows very little (svn) activity since 2006. Does anyone know if it is still an active project? Has its functionality been supplanted by the built into LabVIEW diff utility? Does lv-diff support LV 8.2? 8.5?

Carlos: That project is run by Ian Dees. I’m not sure if it is under active development. Also, I’m not sure if anyone outside of NI knows, yet, how to hook into the Merge functionality inside LabVIEW. This information would be necessary if one is going to create their own commend-line tool to integrate with LabVIEW.

“Also, I’m not sure if anyone outside of NI knows, yet, how to hook into the Merge functionality inside LabVIEW. This information would be necessary if one is going to create their own commend-line tool to integrate with LabVIEW.”

The merge utility is supplied as an external executable, so you should be able to call that.
Tomi gives an example here

beyond compare is really good for compares text files / folders, even images (there is a image compare plugin)
however, my case is to compare two different version of pdf files
I know that adobe acrobat 3d can do that at menu “Advanced->Compare Documents”
It is possible to make it avaible within tortoiseSVN ?

jindili: if it is possible to compare two PDFs using the command line or ActiveX, then you should be able to do it. Take a look at how TortoiseSVN diffs word documents. It calls a javascript file, “C:\Program Files\TortoiseSVN\Diff-Scripts\diff-doc.js”, which uses ActiveX to compare two doc files. If Acrobat 3d exposes an ActiveX interface for comparing docs, then you could do something similar for PDFs.