configuration - 如何在 Windows ClearCase 中使用 ediff (emacs diff) 作为差异/合并工具?

标签 configuration emacs diff clearcase

我在工作中被迫使用 ClearCase(Windows 版本),我想使用 emacs ediff 作为差异和合并工具。 ClearCase 映射文件的问题在于它需要 .exe 文件 - 我试图指定一个批处理文件调用 ediff它没有用。

我不想编写一个 C/C++ 程序(自从我用 C 为 Win32 编写任何代码以来已经超过 10 年了)会调用 ediff有适当的论据。有没有更简单的方法?

也可以看看:

Any way to use a custom diff tool with cleartool/clearcase?

最佳答案

如本文所述 SO question , map 文件允许您调用外部差异工具。

对于 Windows,您应该先尝试 to call emacs in ediff mode :

   emacs --eval "(ediff-files \"file_1\" \"file_2\")" 

或者
   xemacs -eval "(ediff-files \"file_1\" \"file_2\")" 

(应该调用 XEmacs ediff 的新实例)

如果这有效,你可以写一个 .bat映射文件调用的文件,并构建适当的“emacs ediff”命令行。

东西along the lines的:
@echo off
set local
if !%XEMACS_PATH%!==!! SET
XEMACS_PATH=C:\<XEmacs-Path>\i586-pc-win32
set FILE1=%~1
set FILE2=%~2
REM * Bad habit - working on administrative shares.. Why is $->$$ not needed?
REM SET FILE1=%FILE1:$=$$%
REM SET FILE2=%FILE2:$=$$%
REM * Escaping backslash..
SET FILE1=%FILE1:\=\\%
SET FILE2=%FILE2:\=\\%

"%XEMACS_PATH:"=%\gnudoit.exe" "(ediff \"%FILE1%\" \"%FILE2%\")" 

如果 map 文件不能轻松调用 .bat 文件,只需 generate an .exe from your .bat .

我做了一些测试,结果是:
  • “与以前的版本比较”实际上是在调用:
    cleartool diff -graphical -pred myFile
  • 通过 cmd.exe 调用调用 .bat 不起作用
    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"")
  • 在 .exe 中转换 .bat 确实有效
  • arg2 ( %2 ) 和 arg4 ( %4 ) 是您要找的, arg5 ( %5 ) 是为上一版本的内容创建的临时文件的名称(对于无法访问扩展的快照 View )路径名)

  • 所以下面的 bat(在 exe 中转换)有效 仅来自命令行 (不是来自 ClearCase Explorer:DrWatson):
    "C:\Program Files\WinMerge\WinMergeU.exe" %4 %5
    

    您应该能够使其适应 Xemacs,但是 Alex's suggestion ( working with Clearcase from Emacs ) 可能是另一个更实用的解决方案。

    关于configuration - 如何在 Windows ClearCase 中使用 ediff (emacs diff) 作为差异/合并工具?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/658127/

    相关文章:

    mysql - mysql中datadir和innodb_data_home_dir有什么区别?

    emacs - Emacs 命令的打开定义

    apache - Tomcat 子域关联

    emacs - Emacs/Elisp 中的多态回调

    Emacs 自动完成 : add existing dictionary to a major mode

    算法:查找保留顺序的两个字符串之间的所有公共(public)子字符串

    php - 将数组与 array_diff 进行比较 - 但仅比较第一个字符

    git - 如何获取 GitHub 推送的电子邮件差异?

    user-interface - 如何配置 ActiveMQ 5.10.0 HawtIO 接口(interface)?

    Java Log4j2 Syslog Appender