Oso XML Merge

2.2 - Integrating with P4V

The P4V Edit menu showing the Preferences option at the bottom. P4V allows third party tools to integrate to provide comparison and non-automated merge operations for complex file types. This page details how to integrate Oso XML Merge to provide comparison and merge services for Visual Studio project files. The steps here though can be adapted for any type of XML file.

First you should launch P4V, and open the Preferences Dialog. This is done by selecting the Preferences... option at the bottom of the Edit menu as shown in the image to the right.


 
First we'll set up Oso XML Merge to compare files. Click on the Diff item in the tree on the left of the preferences dialog and then on the Add button on the right to open the Add File Type dialog:

The P4V Add File Type Dialog showing the settings for Oso XML Merge filled in.

Fill in the information for the new file type as detailed below:

Extension
.vcproj
This is the file extension for pre-2010 Visual Studio project files.

Application
Browse to the Oso XML Merge application folder and select the Oso XML Merge executable. This will be located under either Program Files or Program Files (x86) depending on which version of Oso XML Merge you installed, and whether you are using a 32-bit or 64-bit version of Windows.

Arguments
-compare -left %1 -right %2
These are the command line options instructing Oso XML Merge to compare the two files specified by P4V.
When you have filled out the above details, click the Save button to save the changes in P4V. P4V should now invoke Oso XML Merge when you attempt to compare two Visual Studio project files.


Now we'll set up P4V to use Oso XML Merge when merging files. P4V always performs three-way merges with a common base file and two changed files that are combined into a single result file.

In the P4V preferences dialog, click on the Diff item in the tree on the left, and then on the Add button as before to open the Add File Type dialog:

The Add File Type Dialog with the settings for Oso XML Merge filled in.

And once again, fill out the information for the new file type as below:

Extension
.vcproj
This is the file extension for pre-2010 Visual Studio project files.

Application
Browse to the Oso XML Merge application folder and select the Oso XML Merge executable. This will be located under either Program Files or Program Files (x86) depending on which version of Oso XML Merge you installed, and whether you are using a 32-bit or 64-bit version of Windows.

Arguments
-merge -base %b -left %1 -right %2 -result %r
These are the command line options instructing Oso XML Merge to merge the three input files specified by P4V into a single output file which P4V will read back once the merge is complete.
When you have filled out the above details, click the Save button to save the changes in P4V. P4V should now invoke Oso XML Merge when you attempt to resolve conflicted Visual Studio project files.


You can add any other XML file associations for Oso XML Merge in exactly the same way. The only difference from the steps above is the file extension of the files you wish to associate with Oso XML Merge. For example, you can use Oso XML Merge to compare and merge Visual Studio property sheets by replacing the .vcproj file extension with .vsprops.