Perforce Server Integration

Top  Previous  Next

The Code Collaborator server can be configured to communicate directly with your Perforce server.  This allows users to review submitted changelists completely from the browser, without having to install any client programs.  To enable this feature, create an entry for your Perforce server in the Version Control tab of the administration interface.  Version control server entries are also created automatically if one of the client programs uploads files from a server that doesn't match any of the currently configured servers.

perforce-server-edit

Title

The title is displayed to users, so it should be something that everyone will understand, even if they're going through proxies, VPNs, or other such things.  When a version control server entry is created automatically, this is filled in with the server address (p4port) of the server.

Attach changelists from browser

If enabled, this feature lets users select submitted changelists to review directly from the web browser, without having to install any client programs.

P4 Executable

Full path to the P4 executable

P4PORT

Address to use to connect to the server.  When a version control server entry is created automatically, this is filled in with the server address obtained from the client.

P4USER

Perforce user name

P4PASSWD

Perforce password or ticket

P4CHARSET

Perforce character set used for translation of Unicode files

Perforce Protections

The Code Collaborator server can be configured to check Perforce protections with the Perforce server whenever a user tries to access a file.

perforce-server-protections

When enabled, Code Collaborator will check access permission with your Perforce server whenever a user tries to access the content of a file managed by this server.  Note that this assumes that the user's Perforce username is the same as their Code Collaborator login.

To check Perforce protections the configured P4USER must have Perforce "super" permission.  If you don't want to provide an account with that level of permission, you can instead configure a script for Code Collaborator to run instead of calling 'p4 -s protects' directly.

The script will be passed arguments "-p <p4port> -u <user> -h <host> <depotPath>".  For example, this script could be implemented as a Windows batch file:

@p4 -u admin -s -p %2 protects -u %4 -h %6 %7

The script must produce exactly the same stdin, stdout, and process error code as if Code Collaborator ran "p4 -s protects" directly.  Also make sure the script runs as fast as possible, because it will be invoked every time any user tries to view the contents a file from this server.

Client Configuration Mapping

You can supply java-style regular expressions to map changelists uploaded from our client tools to this Perforce server.  It is important to set up these regular expressions so that files uploaded by the various Code Collaborator client tools are correctly associated with this server-side Perforce configuration.

perforce-server-mapping

P4PORT Pattern

Match on the client's configured P4PORT.  Using the Server Address Pattern is better, but clients before 5.0.5009 didn't upload "Server Address", so you can configure this as a fallback.

Server Address Pattern

Match on the "Server Address" returned from running "p4 -p <p4port> info" on the client.  This is generally more reliable than matching on the P4PORT, and works through Perforce proxy servers and other complications.  When a version control server entry is created automatically, this is filled in with the server address obtained from the client.