The Merge plugin for Perforce enables Merge to access files located within a Perforce depot. The plugin requires the Perforce
command line client (p4.exe) to be installed and present in your system PATH environment variable.
Merge v6.5.2105 onwards
-
The plugin is included as a standard part of the Merge installation.
Merge v6.5.2104 and earlier
-
The plugin uses the Microsoft .NET Framework, which must be installed before the plugin.
What you can do with the plugin
Using the plugin, you can (for example) perform a folder comparison to compare the Perforce depot against your local client workspace. Alternatively, you could directly compare different branches (or the same branch at different points in time) within the depot. You could then launch file comparisons for any pairs of modified files that were of interest. This approach can work well for performing code reviews.
The plugin provides read-only access to the Perforce depot. To modify files within the depot, you will need to use one of the Perforce tools to open/edit/submit files.
Using the Perforce plugin
To specify a file or folder within a Perforce depot, prefix the path to the depot file or folder with p4: to form a uri. A user name, password, and database computer and port can be included in the uri, as shown in the examples below.
Note that if a username is specified, a host and port must also be specified.
Examples
| URI | Description |
|---|---|
| p4://depot/notepad | Specifies the most recent version of the folder //depot/notepad. |
| p4://depot/notepad/notepad.cpp | Specifies the most recent revision of the file //depot/notepad/notepad.cpp. |
| p4://depot/notepad@2000/03/23 | Specifies the folder //depot/notepad, as it was on 23 March 2000. |
| p4://depot/notepad@12345 | Specifies the folder //depot/notepad, as it was at changelist 12345. |
| p4://depot/notepad/notepad.cpp#43 | Specifies revision 43 of file //depot/notepad/notepad.cpp. |
| p4://jrs@cat:1666/depot/notepad/notepad.cpp | As above, but logging into a Perforce database located on the host and port cat:1666, as user jrs with no password. |
| p4://jrs@cat:1666///depot/notepad/notepad.cpp | As above. The inclusion of the extra // before the depot is optional. |
| p4://jrs:wibble@cat:1666/depot/notepad/notepad.cpp | As above, but specifying a password wibble. |
| p4://jrs:*@cat:1666/depot/notepad/notepad.cpp | As above, but specifying that Merge should prompt for a password to be entered. This ensures that the password is not shown on the screen or within comparison reports. |
Accessing files and folders already in your client workspace
If files or folders are already synced in your client workspace, you access them as you would any other file or folder on
your hard disk. You don’t need to use the p4:// syntax described above to do so.
Integrating Merge with the P4Win, P4V and the Perforce command-line
Merge itself integrates well with Perforce. For more information, see Integrating with Source Control, Configuration Management and Other Applications.
