vc-p4 is an implementation of vc, the version control interface built in to Emacs, for Perforce, a proprietary centralised version control system. vc-p4 was originally developed by Jonathan Kamens, and I forked it and started adapting it to Emacs 23, notable additions being the vc-dir mode and commands acting on several files at once.
Checking it out with Perforce
The adventurous may wish to follow development through Perforce. Since you
probably want to use at least two different Perforce working directories
(unless you use Perforce only to improve vc-p4), you need to set the
P4CONFIG environment variable in your
~/.profile or other suitable
Then create a directory for vc-p4, put a
.p4config file in it containing:
p4 client, which will use the editor specified by the
environment variable to let you edit your client specification. Check that
Root names the directory where you want vc-p4, and under
View at the
very bottom delete all lines and enter this, substituting
the actual client name:
p4 sync, which should get you the latest version of the two
p4-lowlevel.el. The same command is used to check
for and update to new versions.
The public.perforce.com wiki warns that client specifications belonging
to unregistered users are periodically purged, so you may need to redo the
p4 client step above.
Now that you have the files, activate vc-p4 by adding this to your
(add-to-list 'load-path "/path/to/vc-p4/") (require 'vc-p4)
When you visit a file that is managed by Perforce, the mode line contains an
indicator such as
P4-42, 42 being the file's revision number. If you want
to open it for editing, hit
C-x v v, which will call
p4 edit, make the
buffer writable, and change the indicator to
P4:42 to indicate that the
file is opened.
Once you have edited the file as desired, hit
C-x v = to see the diff
against the file in the depot. If after inspecting it you want to commit,
C-x v v again, which will give you a buffer where you can write a log
C-c C-c when done, and your changes will be submitted and
the buffer will be read-only again.
To work with several files at the same time, you'll want VC Directory mode, which the manual describes better than I could do.