Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using P4Merge to merge XML

My (large) company uses Perforce for most of their source control. (I can't escape this.)

A coworker and I often have to work on the same XML-based file at the same time. When it comes time to merge our changes, P4Merge is often not as smart as I'd like. For example, consider this super-simple XML file and two colliding variations:

Simple XML file and two variations with the same closing tag in the same place.

As shown, P4Merge is not XML-aware, and keeps only one copy of the common </b>.

How do you either modify the Perforce tool itself to support smarter XML merges, or how could you modify the Perforce toolchain to use a smarter merge tool as part of the Resolve process?

like image 523
Phrogz Avatar asked Oct 16 '12 22:10

Phrogz


2 Answers

There's a tool called Project:Merge that might do a better job of handling XML content, and it integrates with Perforce:

http://www.projectmerge.com/help/en/integratep4v.php

Update: Project:Merge has been renamed to Oso XML Merge and updated since this post was made. The most recent version can be found here.

like image 80
randy-wandisco Avatar answered Sep 22 '22 15:09

randy-wandisco


Assuming that you're using P4V / P4Win, you can change the default diff and merge tools from the Perforce tools to the ones that you prefer. See this page from the P4V manual.

like image 44
gareth_bowles Avatar answered Sep 21 '22 15:09

gareth_bowles