See for instance "How do I integrate Beyond Compare with ClearCase?"
You need to modify
# up to ClearCase 7.0
c:\program files\rational\ClearCase\lib\mgrs
or
# ClearCase 7.1 and more
c:\program files\IBM\RationalSDLC\ClearCase\lib\mgrs
See the technote swg21256807 for detail on Changing the XML Diff/Merge Type Manager.
For any type manager that uses xmldiffmrg
, replace the xmldiffmrg
executable with your own.
Example (not for your tool, but you get the idea):
_xml2 compare ..\..\..\..\KDiff3\KDiff3.exe
_xml2 xcompare ..\..\..\..\KDiff3\KDiff3.exe
_xml2 merge ..\..\..\..\KDiff3\KDiff3.exe
_xml2 xmerge ..\..\..\..\KDiff3\KDiff3.exe
Note: The mapfile
uses a relative path from its current location to find the executable.
In this example, KDiff3
was installed to the default directory on Windows (C:\Program Files\KDiff3
) thus the relative path defined in the map file reflects as such.
After a couple days of messing around, I found a solution that I think works for me. Maybe it could work for other people as well.
The MS XML Diff and Patch tool was a viable option. When you Diff first file against the second file it creates an XML "DiffGram" listing what changes it detected between the two XML files.
To take care of all 3 rules that I listed above, I Diff'd the two files in one direction, then opened the DiffGram file using Linq-to-XML and Removed all the "Add" and "Remove" lines.
XNamespace xd = "http://schemas.microsoft.com/xmltools/2002/xmldiff";
var doc = XDocument.Load(_diffGramFile);
doc.Root.DescendantsAndSelf(xd + "add").Remove();
doc.Root.DescendantsAndSelf(xd + "remove").Remove();
Then I patched up (merged) this edited diffgram against the first file and created a partially merged temporary file. This takes care of Rules 1 and 2.
Next, I Diff'd the partially merged file against the first file used. Then opened the new DiffGram and removed all Change references to "UseExistingValue".
var newdoc = XDocument.Load(_diffGramFile);
newdoc.Root.DescendantsAndSelf(xd + "change")
.Where(x => x.Value == "UseExistingValue").Remove();
And merged this edited DiffGram against the partially merged file which takes care of Rule 3. Saving this out to XML then produces the final XML merged according to the rules defined above.
Hopefully this can help out other people.
HINT: After installing the XmlDiffPatch library, the XmlDiffPatch DLL can be found in C:\Windows\assembly\GAC\XmlDiffPatch\1.0.8.28__b03f5f7f11d50a3a\XmlDiffPatch.dll
Best Answer
We have had the same problem. How to fix it: Open
regedit.exe
and delete the whole branchHKEY_CURRENT_USER\Software\Atria\ClearCase\CurrentVersion\XML Diff Merge
.Restart
ClearCase Explorer
.The previosly deleted regestry
key/branch
will be re-create with default values.Then the merge window is visible again.