CVS usage at KLOE


DESCRIPTION

This man page explains briefly how to use the CVS package at KLOE and gives a list of the main commands.

CVS is an acronym for "Concurrent Versions System". It is used to keep track of source changes made by group of developers working on the same files. The files and all their versions are kept in a directory called "Repository". In the KLOE offline environment this directory is physically created under the offline library root directory, i.e. :

			offline/xxx/cvsroot
where "xxx" stands for the name of the library (trk, emc, doc, etc.). This is done because the repository does not depend on any version or flavor of the library, but it depends exclusively on the machine independent source code. The directory structure for an offline library is described elsewhere (KLOE Memo No. 4). The CVS repository has been made and customized for KLOE usage. Please, do not modify any of the files in offline/xxx/cvsroot/CVSROOT. These are CVS administration files.

CVS operates on a single file or a collection of files called "module" (for those familiar with DEC/CMS a CVS module is like a CMS group). In all offline CVS repositories two modules have been created by default: the "xxx" module which contains all source files for the library and the "inc" module which contains all include files. The doc package is an exeption. There, only the doc module is available. Other two "links" have been created to these two default modules: these are "ref" and ".". When the module "xxx" is taken out of a repository for modifications to one or more of its files, CVS creates in the working directory of the user issuing the request a subdirectory having the name "ref" ("doc for doc); in this subdirectory it creates a copy of all files belonging to the module plus a CVS directory containing administrative files. This CVS directory contains, among the others, a reference to the actual path to the CVS repository. For instance, if a user "fetches" out the repository the "emc" module in the directory /u1/miscetti/emc, then cvs creates the subdirectory /u1/miscetti/emc/ref where all files belonging to "emc" will be put. If the user "miscetti" "fetches" out the module "inc" as well, then all emc include files will be put in the directory /u1/miscetti/emc/.
Once the user modifies a set of files, he/she can decide to tag this files with a label characterizing that specific library version. There are two kinds of tags: one which is local to the files fetched out in the librarian working directory, and one which is set in the CVS repository. We recommand to always use this last one, via the command "cvs rtag" tag or better both (commands "cvs tag" and "cvs rtag"). We would like to establish also a convention for tag names. All library releases should have a name starting with "v" and followed by the major release number followed by an "_" and a minor release number (es. v1_0).

If you are an offline librarian for the library "xxx", in order to use CVS you have to enter the following commands in the following order:

               % setup offline
               % setup -e xxx <version>
               % setup cvs
Note that only if you have write access to the "xxx" area you are able to operate in CVS. Otherwise you can only look at the status of the files and send on the screen the listing of one or more files, but you cannot get files out of the repository. This CVS behavior can be changed to allow KLOE members to access in readonly mode the repository (please, send your customization requests to flavia@hpkloe01.lnf.infn.it). The "-e" switch on the "setup xxx" command allows you to setup the envs for your library in "extended" mode, setting up the envs that you need in order to modify and build your library. So the "-e" switch sets up also the CVSROOT environmental variable to point to the repository location. Note that the CVSROOT env cannot be set in the offline setup for all libraries since it can only point to a repository at the time. For this reason the offline setup unsets the CVSROOT variable, since it execute only a "setup xxx" in non-extended mode. .SH SYNTAX The general syntax of a CVS command is the following:
    cvs <global_options> command_name <options> [file ...]
where the [] brakets indicate optional argument. The <global_options> affect how CVS works. Examples are:
         -q     Quiet
         -Q     Very Quiet
         -H     Help
         -n     Don't execute
The <options> are local and specific to the particular cvs command:
       -r <revision>  Specify a revision of the file or module
       -l             Local directory only

MAIN COMMANDS

Here we give a list of the main CVS commands.

To create the first release of your library, first clean up the $K_XXX/ref directory to only contain the library source files and then execute:

          % cd $K_XXX/ref
          % cvs import -m"XXX release 1.0" xxx v1_0 v1_0
          % cvs rtag -r v1_0 v1_0 xxx
Execute the same commands in the directory $K_IXXX for the include files:
          % cd $K_IXXX
          % cvs import -m"XXX INC release 1.0" xxx/inc v1_0 v1_0
          % cvs rtag -r v1_0 v1_0 inc
To check the history for the release you just created, execute:
          % cvs history -T -a
To fetch out a module to change some of the files in it:
          % cd 
          % cvs checkout -r v1_0 xxx
          % cd ref
          Modify files .....
To put back all changes in the repository, first made an update to make sure nobody else has modified the same files at the same time, then "commit" back your changes to the repository. At the end, release and delete your local copy of the module:
          % cd /ref
          % cvs update -A
          % cvs tag v2_0 .
          % cvs commit
          % cvs rtag -r v1_2 v1_2 xxx
          % cd ..
          % cvs release ref
You can add a new file to the repository using the command:
          % cvs add [file ...]
To remove a file from the repository, please contact flavia@hpkloe01.

For further information refer to the CVS manual.

EXAMPLE

 % cvs history -T -a
 T 12/06 19:29 acalk trk [v1_0:v1_0]
 T 12/07 10:32 acalk trk [vers_june_1995:v1_0]
 T 12/07 10:32 acalk trk [v1_0:D]
 T 12/15 16:52 acalk trk [vers_june_1995:D]
 T 12/15 16:55 acalk trk [june_1995_vers:A]
 T 12/15 20:34 acalk trk [june_1995_vers:D]
 T 12/15 20:47 acalk trk [june_1995_vers:A]
 T 12/15 21:08 acalk trk [june_1995_vers:D]
 T 12/15 21:19 acalk trk [june_1995_vers:A]
 T 12/18 15:19 acalk trk [aug_1995_vers:A]
 T 12/19 16:12 acalk trk [oct_1995_vers:A]

FILES

offline/xxx/cvsroot
$CVS_DIR/*

"SEE ALSO"

The CVS manual available in the KLOE WWW Offline Manual Page.

Last updated July 30, 1996

Suggestions ? Please contact flavia@hpkloe01.lnf.infn.it