I’m forced to use ClearCase (Windows version) at work, and I want to use emacs ediff as a diff and merge tool. The problem with the ClearCase map file is that it requires .exe files – I’ve tried to specify a batch file calling ediff and it didn’t work.
I don’t want to write a C/C++ program (it’s been more than 10 years since I’ve coded anything in C for Win32) that will call ediff with the proper arguments. Is there a simpler way?
As mentioned in this SO question, the map file allows you to call an external diff tool.
For Windows, you should try first to call emacs in ediff mode:
or
(should invoke a new instance of XEmacs ediff)
If this works, you may write a
.batfile called by the map file, and building the appropriate ‘emacs ediff‘ command line.Something along the lines of:
If map file is not at ease with calling a .bat file, simply generate an
.exefrom your.bat.I have done some tests and it turns out:
‘compare with previous version’ actually calls:
cleartool diff -graphical -pred myFilecalling the .bat through a cmd.exe call does not work
c:\Program Files\Rational\ClearCase\lib\mgrs\maptext_file_delta xcompare 'c:\WINDOWS\system32\cmd.exe /c c:\cc\test.bat'cleartool: Error: Operation 'xcompare' unavailable for manager 'text_file_delta'(Operation pathname was: 'C:\Program Files\Rational\ClearCase\lib\mgrs\'c:\WINDOWS\system32\cmd.exe /c c:\cc\test.bat'')transforming the .bat in .exe does work
arg2 (
%2) and arg4 (%4) are what you are looking for, with arg5 (%5) the name of the temporary file created for the content of the previous version (for snapshot view which can not access extended path name)So the following bat (transformed in exe) works from the command-line only (not from the ClearCase Explorer: DrWatson):
You should be able to adapt it to Xemacs, but Alex’s suggestion (working with Clearcase from Emacs) might be another more practical solution.