Wiki software last updated 28-Jul-2014 - Comments to Ruben Squartini <ruben@auger.org.ar>

How to use a CVS Code Repository

The following page describes

  • How you can get access to the code repositories of the FD-DAS group
  • How you can get code from this repository
  • How to update your files and commit your changes
  • Gives you some links to CVS (Concurrent Version System)

It is just an overview and a guide for the very first steps into our code repository. I recommend to have at least the documentation of CVS by hand to understand the different options of the various CVS commands.

Accessing the code repository

In bash syntax you have to set the following:

export CVS_RSH=ssh

or

export CVS_RSH=`which ssh`

and

export CVSROOT=:ext:user@ccali.in2p3.fr:/afs/in2p3.fr/home/throng/pauger/cvs

(obviously, you have to replace user with your username)

For further details how to access the code repository in Lyon (e.g. how to obtain an account) have a look at this cvs-page.

Which modules are in the repository ?

CVS follows a so called module based approach of project organizations. A module can be a set of several files distributed in several directories. A module can also contain several other modules. Usually the names of the top directories in the CVS repository can be addressed as modules. But the main problem is to get knowledge about this when you have no direct (file system based) access on the repository structure. First you have to checkout the modules files:

cvs co CVSROOT/modules

It is then in the directory CVSROOT editable for you and you might change some definitions there. Then you have to put it back into the repositories administrative directory:

cvs commit CVSROOT/modules

If you don't want to edit something you will have at least the information about the modules defined in the specified repository. Finally you release this directory as you don't longer need it:

cvs release -d CVSROOT/modules

Extracting code from the Repository

After having set your password for CVS correctly you can start to extract or insert code into the repository. For extracting code you must know, of course, how the module is called inside the repository.

To extract for example the complete sources of the Auger-Monitoring you have to type:

cvs co AugerMonitoring

You will end up with a directory AugerMonitoring and one or more subdirectories containing the desired code.

Updating and Committing

Before you can commit your changes to the code repository you must first update your files with any changes which have been committed to the repository before. You can always check the status of your working directory (and its subdirectories) with respect to the repository with the cvs status command. Having defined an alias:

alias status "cvs status -v | grep Stat | grep -v Up"
status

shows you all files somehow changed.

Updating

You type:

cvs update

You will get messages like:

cvs updating foo1.c
cvs merging foo2.c
cvs merging foo3.c
cvs: warning: file had conflicts on merge

The latter case shows that the merging could not be always done without problems. If the changes of two programmers are to close to each other or even overlapping you will get this result. Such conflicts you have to resolve manually.

cvs: warning: foo4.c is not (any longer) pertinent

In this case, a file was deleted from the repository. If you want to commit any changes to that file you have a really big conflict. Try to solve it by discussing the problem with the person who deleted that file.

Committing

You type:

cvs commit

First cvs will check the status of all your files. If you missed any update, cvs will report an error to you which has to be corrected first. The you will be prompted by an editor for your log messages which you can leave empty, though I don't recommend to do so. You could set the editor to your preferred editor, for example:

setenv CVSEDITOR nedit

The default editor is usually vi. Be aware, that some editors require a correctly set $DISPLAY variable and sufficient X permissions.

Here are some useful links for the CVS version management system


(This text is a slightly modified copy of Hermann-Joseph's CVS page)


Log In