Contents Previous Next

5. CVS Reference

The CVS utility is used to put all user editable files under source/release control. This section gives a brief description of the commands normally used by application developers. Consult the CVS manual for more details.


Your environment variable CVSROOT should point to the CVS repository for IOC Applications. The following command displays the location of CVSROOT:
For example, at APS/ASD the command should show:
At APS all <top> applications are stored under $CVSROOT/iocsys. Ask your EPICS system manager about the use of CVS at your site.


This section gives a brief description of the CVS commands. Wherever <filename> is shown a list of filenames is allowed. If <filename> is not specified then most commands apply to the entire directory and all subdirectories.

A useful option for cvs is:

cvs -n <command>
This will execute any command to demonstrate what it would do without actually making any changes to the current directory or the repository.

cvs help
gives overall cvs help.

To check out an entire <top> area issue the commands:
cd <anywhere>
cvs checkout iocsys/<top>
This will retrieve the latest version of iocsys/<top> into <anywhere>/iocsys/<top>

Files (or complete directory trees including and entire <top> area) can have a watch placed on them. When a watch is placed on a directory cvs creates working copies read only. Users must execute a cvs edit command to obtain a read/write file. Facilities are provided to list all people editing a file and to be sent an e-mail message whenever someone executes the cve edit or commit commands for a watched file. Read the CVS manual for details.

If you want to edit a file and it is read only because a watch is in effect then execute the command:
cvs edit <filename>
If you have started editing a file and decide to abandon your changes or not make any changes issue the command:
cvs unedit <filename>
The command:
cvs add <filename>
places a directory or file under CVS control. This command must be given for each directory and file to be added to the repository. A subsequent commit command will also be required.

The command:
cvs rm <filename>
removes the specified file from the repository. The file is not actually deleted but is moved to the "attic". Thus previous versions can still be retrieved.
The command:
cvs diff <filename>
compares the working copy of the file with the latest version in the repository.

The diff command has options that allow you to see the differences between any two versions committed to the repository.

The command:
cvs update -d <filename>
brings the development area into sync with the latest versions committed to the repository. A message starting with U is given for each file or directory that is updated. If the message starts with M the file named has been modified in this directory. A message starting with the letter C means that a conflict was found between the working file and a change in the repository. Conflicts must be resolved manually (edit the file and look for regions bounded by <<<<<< ====== and >>>>>> characters).

The option -d means add any new subdirectories that have been created in the repository.

The command:
cvs commit <filename>
commits changes to the repository. You are asked for comments via your favorite editor.

The command:
cvs status <filename>
shows the status of the file. The -v option shows all tag information for the file.

The command:
cvs log <filename>
displays the commit messages for all versions of the specified file.

The command:
cvs tag <official release name>
is used by the Application System Manager to tag official application releases.

This command is used to put an existing tree of files into the cvs repository. Assume that a developer has created a new directory tree for a new <top> application in a directory newapp. It can be imported into the repository via the command:
cvs import -m "Creating" iocsys/newapp newapp start

.cvsignore file

Any directory can contain a file with the name .cvsignore. It contains a list of file and directory names and filename patterns that should be ignored by CVS. For example all generated directories and files should be listed in .cvsignore.

.cvsrc file

CVS will use a file called .cvsrc in your home directory to specify default options to its commands. The following settings are strongly recommended for use by all users. Note that the gap between the CVS command name and the option letters must be a tab character, not just spaces:
checkout    -P
update    -d -P
export    -kv
The -P options to checkout and update cause CVS to remove any empty directories. Update's -d option tells it to create any directories that have been added to the repository since the last update. The -kv flags to export cause it to replace any RCS keywords (e.g. $Id$) with strings which will not be changed if the exported source code is later imported into a different repository.
Contents Previous Next