The PCL-CVS package provides to user very effective way to work with the CVS, that widely used for software development, especially for open source projects1. Besides standard features, provided, the VC package, this package implements following:
This package is included into GNU Emacs's distribution starting with version 21. It also available as a package for XEmacs. For other Emacs's versions you can find source code at ftp://flint.cs.yale.edu/pub/monnier/pcl-cvs.
All work with package is performed in special buffer, created by PCL-CVS functions. This
buffer is called
*cvs*, and used to display files, their statuses and other information.
Some of package's functions work only with existing directories, so you need to fetch data
from a repository before running any PCL-CVS function.
During work you can navigate in buffer and perform different functions on selected (or file where cursor is placed) files. For each file in project some status is assigned, and list of available functions depends on this status.
Information in buffer is separated between several columns:
*sign for marked files;
File status can has one of following values:
.#FILE.VERSION. Besides conflicts due the different content of change, there are other types of conflicts, displayed as additional status: removed — you removed file, but somebody change it in repository; added — you added file, but somebody also add and commit it; modified — you changed the file, but somebody removes it from repository;
cvs removecommand for it wasn't performed.
Many of functions, implemented by the PCL-CVS package has the
cvs- prefix and names,
similar to names of CVS commands. Some functions could be executed only in the
buffer, that could be created one of following functions (functions usually run via
binding, either via
cvs updateon specified directory;
cvs -n updatecommand, that just check state of directory without changing directory;
cvs statuscommand on specified directory;
cvs checkoutcommand for specified module;
*cvs*buffer, using data from
CVS/Entriesfiles. This function is similar to the
cvs-examinefunction, but it doesn't require access to repository.
These functions could be also executed in the
*cvs* buffer — you can use
cvs-status. You can also perform
corresponding commands on selected files —
cvs-mode-update) to update files,
cvs-mode-examine) to update information about files, and
cvs-mode-status) to get
status information for selected files.
By default, all these functions are performed recursively, but you can change this
behaviour if you pass the
-l option to CVS.
To navigation inside the
*cvs* buffer user can use following functions:
n key) — to move to the next line, and
p key) that move to
There are several functions to work with marks. To mark one file, you can use the
cvs-mode-mark function (
m key). To remove mark from file there is the
u key). To mark all files user can use
M key (
and to remove selection from all files, user can execute
function, that bound to
M-DEL. You can also use the
% key) to mark files, which names matches given regular expressions. There is also
cvs-mode-mark-on-state function (
S key), that mark files with given status.
Addition of files is very simple — just mark all needed files (usually they have Unknown
status), and press
a key (
cvs-mode-add function). Status of files will changed to Added,
and you will need to commit these changes to repository (see section Work with changes).
You can also use this function for files with Removed status — this restore them.
To delete files you need to perform almost same sequence — you need to mark files, and to
cvs-mode-remove-file function (
r key). You will asked for confirmation, and if
you answer yes, then files will removed from your directory. If files are registered in
CVS, then the
cvs remove command also will performed. You also need to commit these
changes to repository.
To update files you can run the
cvs-mode-update function, that bound to
O key. This will
cvs update command for all files with Need-update status.
Sometimes, you need to keep some files, not registered in repository. Such files are
displayed with Unknown status, but you can say CVS to ignore that files, just list them in
.cvsignore file. To put selected files into this file, you can use the
cvs-mode-ignore function, that bound to
To commit changes to repository you just need to select needed files, and than press
C key (
cvs-mode-commit-setup). They will create a new buffer, called
*cvs-commit*, in which you can enter your commit message. After you enter message, you
need to press
C-c C-c, and changes will committed to repository. You can abort this
procedure, if you want, just simply not executing
C-c C-c. Difference between
that first function preserve old content of
*cvs-commit* buffer, but second — not.
If you change file, but doesn't want put changes into repository, then you can revert them
by using the
cvs-mode-undo-local-changes function, that bound to
U key. This function
remove modified file, and retrieve latest version from repository.
You can view what was changed using one of several functions. Most often used function is
cvs-mode-diff, that bound to
= key (and also to
d =). This
function show differences between modified file and it version in repository. There are
also several functions to display changes:
To work with changes you can also use Ediff and Emerge. The
cvs-mode-idiff function (
run Ediff or Emerge (depending on current settings), that allow you interactively work
with changes. If you run the
cvs-mode-imerge function (
d E), then you can perform
interactive 3-way merge of changes.
To retrieve information about files you can use two functions. The
cvs-mode-log function (
cvs log for selected files, and result is displayed in the
buffer. And the
cvs-mode-status function (
s key) performs
cvs status for selected files
and also displays data in the
cvs-mode-tag function (
t) you can set a tag to selected files. By default, this
function applied only to directories, but this behaviour from the client's settings.
Sometimes you doesn't want to display some lines in the
*cvs* buffer. You can do this
cvs-mode-remove-handled function (
x), that deletes from buffer already
processed line (for example, files with Up-to-date status), or with
function (it bound to
C-k), that simply deletes lines. Processed files can be deleted
automatically if the
cvs-auto-remove-handled variable has non-
*cvs* buffer, you can use
cvs-mode-revert-buffer function, that bound to
And to leave this buffer, you can use
cvs-mode-quit function (
Behaviour of PCL-CVS functions depends on values of several variables, that you can
M-x customize-group pcl-cvs function. You can customize values of
variables, faces, used to display information, etc.
1. This situation is started to change. Many new free version control systems was developed and used — Subversion, Git, Darcs, Mercurial, etc.
Last change: 05.03.2013 16:54