Perforce Integration
Last modified: September 19, 2023
Setting Up Diff Tool
In order to set Code Compare as the default diff tool for Perforce, perform the following steps:
- Go to Edit > Preferences > Diff, select Other application.
- Enter the following data in the respective fields: Location: “[InstallationDir]\CodeCompare.exe”
Arguments: %1 %2
Setting Up Merge Tool
In order to set Code Compare as the default merge tool for Perforce, do the following:
- 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
- Go to the Perforce Settings: Edit > Preferences > Merge, select Other application
- Enter the following data in the respective fields:
Location: “[path to the .bat file]”
Arguments: %b %1 %2 %r
Using Code Compare with the Perforce Command Line
In order to use Code Compare with the Perforce command line:
- For Diff, execute the following command to specify the path to CodeCompare.exe:
p4 set P4DIFF=”[InstallationDir]\CodeCompare.exe”
- 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.
Was this page helpful?