You are here

Using CVS

1. revision control
2. keeping track of the changes between revisions
3. development of software by more than one researcher
4. easy sharing of the up-to-date sources

Cervisia is a wonderfull GUI to use with CVS, which make life even easier. The following are the basic steps to start using cvs as summarized by Bee Leong:

Example of a CVS repository structure :

$CVSROOT = /local/scratch/cvsroot 

$CVSROOT
|+--comms_it++
| |
| +--ldpc
| | |
| +--Makefile,v
| +--ldpc_prog.cpp,v
!
+--kalman
|
+--Makefile,v
+--kalman.cpp,v
+--OFDM
| |--pilot-estimator.cpp,v
+--MC-CDMA
! |--mc-cdma-estimator.cpp,v

1. Tell CVS where to find the repository. So in the
.bashrc of your home directory, add these 2 lines:

$> export CVS_RSH='/local/<your-user-name>/.ssh/ssh-cvs'
$> export CVSROOT=:ext:prma:/local/cvsroot

Save the .bashrc file and type source ~/.bashrc, or start a new terminal window

2. To import a working directory into CVS

Say for example you have a directory called ldpc already:

$> cd ldpc 
$> cvs import -m "Imported sources" comms_it++/ldpc ldpc start

3. To checkout:

 cvs checkout ldpc 

This will create a directory called comms_it++ and populate the directory with source files.

$> cd ldpc 
$> ls CVS Makefile ldpc_prog.cpp

4. To check in after making changes and while you are in the directory ldpc:

$> cvs commit -m "Added ldpc (N,M)" ldpc_prog.cpp

5. To remove working copy in your PC after checking in:

$> cd .. 
$> cvs release -d ldpc

CVS will check to see what files have been changed since they were checked out. To play it safe you can do

$> cd ldpc 
$> cvs diff ldpc_prog.cpp

This will show you the difference between the file in your working directory and that in the repository. If there is a difference, then check in the file first before doing the `cvs -d release' command.
6. To tag a release:

$> cvs tag release-1-0 .

and to checkout a particular release

$> cvs checkout -r release tc 

7. To ADD files/directories to the repository

$> cvs add ldpc_new_program.cpp 

But before you commit, other developers will not be able to see it. So you must also

$> cvs commit -m "New ldpc program doing ..." ldpc_new_program.cpp 

when you feel that the program is ready.
8. To REMOVE files/directories to the repository

$> cd ldpc 
$> rm *.cpp
$> cvs remove
cvs remove: Removing .
cvs remove: scheduling Makefile for removal
cvs remove: scheduling ldpc_prog.cpp for removal
cvs remove: use 'cvs commit' to remove this files permanently

$> cvs ci -m "Remove unneeded files"
cvs commit: Examining .
cvs commit: Committing .

NOTE: Before commiting, you can still undo the remove command:

$> cd ldpc 
$> rm *.cpp
$> cvs remove
cvs remove: Removing .
cvs remove: scheduling Makefile for removal
cvs remove: scheduling ldpc_prog.cpp for removal
cvs remove: use 'cvs commit' to remove this files permanently

$>cvs add ldpc_prog.cpp
U ldpc_prog.cpp
cvs add: ldpc_prog.cpp, version 1.1.1., resurrected

Or if you realise your mistake before the cvs remove stage, you can
do:

$> cd ldpc 
$> rm *.cpp
$> cvs update ldpc_prog.cpp
cvs update: warning ldpc_prog.cpp was lost
U ldpc_prog.cpp
University of Southampton: