Department of Electronic Systems

Setup

Overview

CVS uses a central place known as the CVSROOT in which a number of modules or repositories can be stored. Normally here at the university at least two modules are used: One for the report and one for the source code for the project. It is however possible to have any number of modules.

To alter the files in a specific module one has to obtain a local copy of the files in the modules. This is called a "checkout". When the files in the module has been altered and the changes should be store they are "commited" to the central repository and the changes will take place.

The steps in order be able to use CVS is:

  1. Setup the CVSROOT
  2. Create modules
  3. Add files to a module
  4. Use the module

Setup the CVSROOT

In this guide we will assume that CVSROOT is located in /afs/ies.auc.dk/group/03gr781/CVS-root. So to create the CVSROOT Alfred would do the following in a shell:

 cvs -d /afs/ies.auc.dk/group/03gr781/CVS-root init 

Now the central place is created.

It is clear that it would be nice not having to type "-d /afs/ies.auc.dk/group/03gr781/CVS-root''. This is indeed possible and it can be done by setting the environment variable CVSROOT. So to set this Alfred would add the line

 export CVSROOT=/afs/ies.auc.dk/group/03gr781/CVS-root

to his .bashrc. Of course this will first be effective by the next login, so to make it effective now he also types the command:

 export CVSROOT=/afs/ies.auc.dk/group/03gr781/CVS-root 

In the rest of this guide it will be assume that the CVSROOT is set to above mentioned value.

Create Modules

In this guide we will assume that two repository is adequate namely one for source code and one for the report. So in order to create the modules Alfred would do:

 cvs checkout CVSROOT  
 cd CVSROOT   
 echo "report report" >> modules  
 echo "code code" >> modules  
 cvs commit -m "Added modules" modules   
 cd ..   
 cvs release -d CVSROOT  

He will now be promted something like:

You have [0] altered files in this repository.
Are you sure you want to release (and delete) directory `CVSROOT'
:

 y

Now the two modules has been added to the CVSROOT and CVS will rebuild its administrative database.
The cvs release -d CVSROOT will make CVS clean up and erase the CVSROOT directory.

However the directories is something that Alfred must add him self. To do that:

cd /afs/ies.auc.dk/group/03gr781/CVS-root      mkdir report code