How to use Beyond Compare 3 as external SVN (SlikSVN) merge and diff tool on Windows?

余生颓废 提交于 2019-12-08 13:12:50

问题


I want to configure SVN command line client SlikSVN with Beyond Compare 3 as external diff and merge tool. How to do this?


回答1:


  1. Add Beyond Compare 3 folder to Windows PATH. If you don't know how check this answer - just replace Python path with Beyond Compare 3 path.

  2. In Beyond Compare 3 folder create bcomp-diff.bat file:

    @ECHO OFF
    
    SET DIFF="bcomp.exe"
    
    SET LEFT=%6
    SET RIGHT=%7
    
    %DIFF% %LEFT% %RIGHT%
    
  3. In Beyond Compare 3 folder create bcomp-merge.bat file:

    @ECHO OFF
    
    SET DIFF3=BComp.exe
    
    SET BASE=%1
    SET THEIRS=%2
    SET MINE=%3
    SET MERGED=%4
    
    REM left MINE
    REM center BASE
    REM right THEIRS
    %DIFF3% %MINE% %THEIRS% %BASE% %MERGED%
    
  4. Now we need to edit SlikSVN config file. On Windows 7 it is located in %USERPROFILE%\AppData\Roaming\Subversion (source). Just paste this into Windows Explorer address bar and edit config file.

    In [helpers] section of config file add/modify as below:

    diff-cmd = bcomp-diff.bat
    merge-tool-cmd = bcomp-merge.bat
    
  5. Restart cmd.exe so that PATH windows variable will be reloaded.

  6. You're done! Try svn diff inside your repository and it should run Beyond Compare 3.

I've made a gist with above batch files.

Batch files are based on this website.



来源:https://stackoverflow.com/questions/19602729/how-to-use-beyond-compare-3-as-external-svn-sliksvn-merge-and-diff-tool-on-win

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!