Search code examples
svnmergetoolbeyondcompare3difftoolslik

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


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


Solution

    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.