| Projects Home | Tools | Style | Autobuild | Doxygen |
Using CVSCVS maintains a "repository" where the sources and revision information is kept. The local server for my projects is on dudels - this is a Linux machine with tight access controls - it does not share account information with the rest of the CS domain, and allows no login access other than ssh. If you are working on a project, you will receive an account on dudels so that you can access this server.
To tell CVS where the repository lives, you must set an environment variable. If you use tcsh or csh, you need to add:
setenv CVSROOT :ext:login@dudels.cs.wmich.edu:/dudel3/cvs (where login is your dudels login name)
setenv CVS_RSH ssh
If you use bash (most Linux users), add the following to .bashrc:
CVSROOT=:ext:login@dudels.cs.wmich.edu:/dudel3/cvs
CVS_RSH=ssh
export CVSROOT CVS_RSH
Working on a project
To retrieve a project from CVS, you need to know the project's directory. If the name of the directory is SDDFUtils, cd to the directory where you want the source tree to reside and execute:
cvs checkout SDDFUtils
At this point you can edit and modify the project source code. When
you have a stable set of changes ready, you need to commit the
changes to the repository. Say you have modified
SDDFUtils/src/Timer.h - you can commit your changes from the
SDDFUtils/src directory by executing:
cvs commit Timer.h
Which brings up an editor where you can describe the changes you
made. You can change the editor by setting the env variable
CVSEDITOR.
If you are using XEmacs, there is an easy way to interact with CVS - under the Tools menu, select "PCL CVS", then "Update Directory". This brings up a file selection window where you can select the project root directory. This action starts up a new buffer in CVS mode and lists all of the files in your copy of the sources which is different than the repository sources.
Right-clicking one of the file names will bring up a list of operations you can perform on the file including reverting the file to the version in CVS and committing your changes to the file.
Ignoring files
Many files in a development project are generated from other file
(e.g. an object file generated from a source code file or the
configure script generated from configure.in). You need to tell
CVS to ignore these files so that you do not inadvertently
commit these to the repository.
The list of files to ignore is initialized by CVS to include most of the standard backup files, core files, object files, library files, etc... You can add new files to the list by creating a .cvsignore file - any elements of this file are ignored in the working directory.
Adding new
files
A file under CVS control has the ability to record revision
information inside the file. This information is updated
automatically whenever a file is checked in to the repository
and can contain complete information about modifications made to
the file. CVS information is usually not compilable and appears
in a comment block at the beginning of the file.
The standard comment block I use records the name of the file, the revision number of the file, the author, the date of last modification and a log of changes made to the file.
/* * $Source: /dudel3/cvs/Projects/Developing/CVS.html,v $ * $Revision: 1.1.1.1 $ * $Author: kkaugars $ * $Date: 2002/01/18 16:02:12 $ * * $Log: CVS.html,v $ * Revision 1.1.1.1 2002/01/18 16:02:12 kkaugars * Project description pages * */The same information can be added to a Makefile.am by replacing the comment character with a #.
Once a file is created (say this one is Localtime.C), it is
added to the repository using:
cvs add Localtime.C
cvs commit Localtime.C
Note: These actions change the comment block, so you will need
to re-load the files into your editor unless you are using XEmacs, new files are listed in the update buffer and
you can perform the actions from the menus. In XEmacs the
buffers containing these files are automatically updated to the
new versions.
More information
The main CVS site is http://www.cvshome.org. The CVS manual can be browsed on-line at http://www.cvshome.org/docs/manual/cvs.html.
On RedHat 7.2, you can find the postscript manual on your system in /usr/share/doc/cvs-1.11.1p1/cvs.ps. Other distributions may have a different CVS doc directory, named /usr/share/doc/cvs-xxxx where XXXX is the version installed on your system.
There is a version of the manual available for download from this server as a tar.gz file cederqvist-1.11.1p1.html.tgz.
The manual is also available for browsing from this server.
| Projects Home | Tools | Style | Autobuild | Doxygen |