The Perforce clients may be distributed around a local area network, wide area network, dialup network, or any combination of these. There can also be Perforce clients on the same host as the server.
Two programs do the bulk of Perforce's work:
p4d
program is run on the Perforce server. It manages the shared file repository, and keeps track of users, clients, protections, and other Perforce metadata.
p4d
must be run on a UNIX or Windows/NT host.
p4
program is run on each Perforce client. It sends the users' requests to the p4d
server program for processing, and communicates with p4d
via TCP/IP.
p4
client programs can be run on many platforms, including UNIX, Windows, VMS, Macintosh, BeOS, and Next hosts.
Files that have been edited within a client workspace are sent to the depot via a changelist, which is a list of files, and instructions that tell the depot what to do with those files. For example, one file might have been changed in the client workspace, another added, and another deleted. These file changes might be sent to the depot in a single changelist, which is processed atomically: either all the changes are made to the depot at once, or none of them are. This allows problem fixes that span multiple files to be updated in the depot at exactly the same time.
Each client workspace has its own client view, which determines which files in the depot can be accessed by that client workspace. One client workspace might be able to access all the files in the depot; another client workspace might access only a single file. The Perforce server is responsible for tracking the state of the client workspace; Perforce knows which files a client workspace has, where they are, and which files have write permission turned on.
When a file conflict is detected, Perforce allows the user experiencing the conflict to perform a resolve of the conflicting files. The resolve process allows the user to decide what needs to be done: should his file overwrite the other user's? Should his own file be thrown away? Or should the two conflicting files be merged into one? At the user's request, Perforce will perform a three-way merge between the two conflicting files and the single file that both were based on. This process generates a merge file from the conflicting files: the merge file contains all the changes from both conflicting versions, and this file can be edited and then submitted to the depot.
release2.0.1
; this name is a label for the user-determined list of files. At any subsequent time, the label can be used to copy the old file revisions into a client workspace.
Perforce's Inter-File Branching mechanism allows any set of files to be copied within the depot. By default, the new file set, or codeline, evolves separately from the original files, but changes in either codeline can be propagated to the other.
We're particularly proud of Perforce's branching mechanism. Most SCM systems allow some form of branching, but Perforce's is particularly flexible and elegant.
return
", or it might be a system improvement request, like "please make the program run faster." Whereas a job represents work that is intended to be performed, a changelist represents work actually done. Perforce's job tracking mechanism allows jobs to be linked to the changelists that implement the work requested by the job. A job can later be looked up to determine if and when it was fixed, which file revisions implemented the fix, and who fixed it.
Perforce's job tracking mechanism does not implement all functionality normally supplied by full-scale defect tracking systems. Its simple functionality can be used as is, or it can be integrated with a full-scale job tracking system with a scripting languages such as Perl.
Permissions are granted or denied based on the user's username and IP address. Since Perforce usernames are easily changed, protections at the user level provide safety, not security. Protections at the IP address level are as secure as the host itself.