Perforce Integration

Setting Up Diff Tool

In order to set Code Compare as the default diff tool for Perforce, perform the following steps:

  1. Go to Edit > Preferences > Diff, select Other application.
  2. Enter the following data in the respective fields: Location: “[InstallationDir]\CodeCompare.exe”

Arguments: %1 %2

Perforce diff tool

Setting Up Merge Tool

In order to set Code Compare as the default merge tool for Perforce, do the following:

  1. Create a .bat file. To do that, create a text document and change its extension from .txt to .bat. Next, open it with any text editor and add the following line:

“c:\Program Files\Devart\Code Compare\CodeMerge.exe” /BF=%1 /TF=%2 /MF=%3 /RF=%4 /SC=P4

Save and close the document

  1. Go to the Perforce Settings: Edit > Preferences > Merge, select Other application
  2. Enter the following data in the respective fields:

Location: “[path to the .bat file]”

Arguments: %b %1 %2 %r

Perforce merge tool

Using Code Compare with the Perforce Command Line

In order to use Code Compare with the Perforce command line:

  1. For Diff, execute the following command to specify the path to CodeCompare.exe:

p4 set P4DIFF=”[InstallationDir]\CodeCompare.exe”

  1. For Merge, execute:

p4 set P4MERGE=”[path to the previously created .bat file]”

Note

Use your product installation folder instead of [InstallationDir]. By default, it is C:\Program Files\Devart\Code Compare.