CVS: Concurrent Version System
BABAR uses Concurrent Version System (CVS) to manage source code.
1 Feb 2005
Related pages: [BaBar Home Page] [Computing] [Free Software]
Table of Contents:
1. Porting CVS-BF
2. Usage of CVS-BF
3. CVS Utilities
- list of modifications and extensions
- fixcvs converts a CVS folder
- kslac run klog to get an AFS token from SLAC.
- cvshis: examines CVS history.
- cvsck: check CVS files in repository.
- cvsweb: web-based CVS repository browser.
The following softwares are needed by CVS, most sites may have installed them already.
- gdiff display differences between two files
- rcs Revision Control System.
- patch apply a diff file to an original.
- texinfo GNU's hypertext system
- perl a shell script language
- man page of cvshis.
- examine prior history:
cvshis $CVSROOT/CVSROOT/ARCHIVE/history-<year>
A CVS-1.11.19 is the latst stabilized version of CVS.
We now encourage the use of CVS 1.11 or later version since it has
security patch. It also allows readonly CVS checkout.
However, do not use CVS 1.12.6 or later versions as yet. Starting from
this version CVS uses a new format for passing parameters to hook scripts.
Since Linux SL3 is using CVS 1.11.2, we are not ready to use CVS 1.12.6
or beyond as yet.
If you receive "LockDir" warnings, your version is older than CVS 1.11.
Either ignore the error or ask your manager to install latest CVS
stabilized version.
http://www.cvshome.org
Porting 1.11.19
Fixcvs is a perl script that cab be used to change the information of a
folder, such as the location of repository, etc, according to the current
value of $CVSROOT. It is supplied with CVS-BF-1.N distribution. For example:
0. The repository is moved from NFS to AFS.
1. You changed the $CVSROOT.
2. cd into the top directory of a folder.
3. fixcvs
Repeat steps 1. and 2. for each module you have checked out.
The script 'fixcvs' is in the top directory of CVS-BF. It is also
installed in $BFROOT/bin at SLAC. A man page, fixcvs.1, is also available
both in the distribution and $BFROOT/man.
kslac is a simple shell script that uses klog to get an AFS token
from SLAC (slac.stanford.edu).
If your site has slow direct AFS access to the repository, try using
the Client-Server model of CVS via SSH network access:
setenv CVSROOT <uid>@<host>.slac.stanford.edu:/afs/ (cont..)
slac.stanford.edu/g/babar/repo [client-server format]
setenv CVS_RSH ssh [use ssh network access]
klog <uid>@slac.stanford.edu [get AFS token at SLAC]
cvs ... [CVS operation]
enter password... [enter password]
Note:
To bypass password, see web page:
/BFROOT/www/Computing/Environment/Tools/Current/SSH.html
Trouble Shooting:
1. There is no response from CVS:
(a) You set bad or incomplete host address
e.g. setenv CVSROOT terryh@kiwi:/u/ec/terryh/repo
kiwi is incomplete host address.
(b) You forget to set CVS_RSH
2. Get message "Sorry, you don't have read/write access to the history file":
The AFS token is not passed to server machine. The klog step only works
for sites that send AFS token. By default most variants of ssh don't
come with AFS token passing, you need to either patch it (the ssh 1.1.27
version) or turn it on (the OpenSSH version, which requires some
external AFS installation).
If you have some personal packages not to be shared by the
public, consider establishing a personal CVS repository to keep these
files.
setenv CVSROOT {repository} [your repository, e.g. ~/repo]
cvs init [initialize CVS repository]
cd source [cd to source directory]
cvs import {pkg} {vendortag} {tag} [import to $CVSROOT/pkg]
cd {tmp} [go to working area]
cvs co {pkg} [check out package]
From now on use 'setenv CVSROOT ..' to toggle between different
CVS repositories. If this repository is to be shared by group of users,
remember to grant write access to two areas:
fs sa $CVSROOT {uid} write [write access to CVS repository]
fs sa $CVSROOT/CVSROOT {uid} write [write access to CVS adminstrative area]
fs sa $CVSROOT/{pkg} {uid} write [write access to per package area]
CVS needs write access to create lock files, so file write access is
equivalent to CVS read+write access. You can set up a AFS group to do this:
pts cg {uid}:{group} -o {uid} [create an AFS group]
pts ad -u {uid1} {uid2} -g {uid}:{group} [add user to this group]
pts rem {uid3} {uid}:{group} [remove user from this group]
pts mem {uid}:{group} [see list of members]
fs sa $CVSROOT/ {uid}:{group} write [give rights of this dir to this group]
fs sa $CVSROOT/CVSROOT {uid}:{group} write [and this directory]
Once this is done, these people can check out _AND_ commit to your
repository.
If you want to separate checkout right and commit right of CVS, it is a little bit harder, you can try the following:
1. Create scripts:
setenv BABAR /afs/slac/g/babar/repo [temporary variable]
setenv CVSROOT /afs/slac.stanford.edu/u/ec/{uid}/repo [your repo]
cd /tmp
cvs co CVSROOT
cd CVSROOT [go to /tmp/CVSROOT]
mkdir -p etc ACL/template
cvs add etc ACL ACL/template [add to CVS repository]
cp $BABAR/CVSROOT/etc/automail $CVSROOT/CVSROOT/etc [copy by hand]
cp $BABAR/CVSROOT/etc/autocopy $CVSROOT/CVSROOT/etc [copy by hand]
cp $BABAR/CVSROOT/etc/checkacl $CVSROOT/CVSROOT/etc [copy by hand]
chmod 755 $CVSROOT/CVSROOT/*
2. Set up hooks:
edit loginfo [add following lines to loginfo]
ALL $CVSROOT/CVSROOT/etc/automail "%s" [start commit notification]
^CVSROOT/ACL/* $CVSROOT/CVSROOT/etc/autocopy "%s" [need auto copy ACL]
^CVSROOT/etc $CVSROOT/CVSROOT/etc/autocopy "%s" [need auto copy etc]
edit commitinfo [add one line]
^name-of-pkg sh -c $CVSROOT/CVSROOT/etc/checkacl [check commit access]
cvs ci [commit loginfo and commitinfo]
3. commit scripts:
cp $BABAR/CVSROOT/etc/automail etc [script to notify expert upon commit]
cp $BABAR/CVSROOT/etc/autocopy etc [script to make reference copy]
cp $BABAR/CVSROOT/etc/checkacl etc [script to check commit access]
cp $BABAR/CVSROOT/ACL/template/acl ACL/template [ACL template]
chmod 755 etc/*
cvs add etc/automail etc/autocopy etc/checkacl ACL/template/acl
cvs ci [add them to CVS]
4. Copy editacl and addacl from $BFROOT/bin to your bin path. Then start to
use editacl to manage ACL. Editacl calls addacl automatically for new ACL.
Take a look at BaBar's $CVSROOT/CVSROOT for examples.
(You can also use cvsnotify)
Take a look at BaBar's $CVSROOT/CVSROOT for examples.
A list of all CVS packages to browse can be obtained on the
cvsweb Main Page. Because of the number of packages, this page can
take a while to load so you will probably want to bookmark the pages for
your favorite packages (e.g
cvsweb page for AbsParm package).
terryh@slac.stanford.edu, pfkeb@kaon.slac.stanford.edu
|