Multibranch CVS setup
If you are not using Eclipse, some other system is required to track the various cvs repositories. This one relies on a defined directory structure and a few python scripts and aliases.
The setup here goes with the ObjectDomain setup described in 'Porting ObjectDomain'.
Cvs repositories
The CCPN code currently resides partly on SourceForge, partly on mole. Checkout commands are e.g.:
cvs -d rhf22@mole.bio.cam.ac.uk:/cvsroot/ccpn checkout -r stable_2_0_6 -d ccpnint -P ccpn
cvs -d rhf22@mole.bio.cam.ac.uk:/data/ccpn/cvsint checkout -r stable_2_0_6 -d ccpnint -P ccpn
Directory structure
Cvs branches all live in a CVSROOT directory, e.g. ~/CCPN/cvsroots/ with names like ~/CCPN/cvsroots//trunk, ~/CCPN/cvsroots/branch4 etc.
Each branch directory in turn has a wrorking directory (e.g. ~/CCPN/cvsroots//trunk/all), and a directory for each different CVS repository, (e.g. ~/CCPN/cvsroots//trunk/ccpn, ~/CCPN/cvsroots//trunk/ccpnint, ...).
The working directory contains symlinks to al files in the individual repository directories. The individual repository directories contain only the files from the repository. Extra files, generated files etc., live in the working directory only. There are some exceptions. The Pythonpath used inside ObjectDomain must be to the CVS dir rather than the working dir, and some .pyc and $py.class files will therefore end up in the repository directory.The reason is that the model description files output from ObjectDomain, whether .odm/.odp or .xml files are checked into CVS and must go directly to the repository directories.
Command aliases and environment parameters
The following are used (from the .cshrc file):
setenv CCPNROOT ~/CCPN/cvsroots
setenv PYTHONPATH {$CCPNROOT}/trunk/all/python
# Run ObjectDomain using configuration directory
alias odt '/home/rhf22/scripts/runObjectDomain.sh -d ~/ObjectDomain/localConf/trunk \!* &'
alias odb4 '/home/rhf22/scripts/runObjectDomain.sh -d ~/ObjectDomain/localConf/branch4 \!* &'
# Go to relevant branch (could be modified / expanded to taste)
alias tot 'cd {$CCPNROOT}/trunk/all/python'
alias tob4 'cd {$CCPNROOT}/branch4/all/python'
# Set PYTHONPATH to relevant branch - must eb done before generating code
alias patht 'setenv PYTHONPATH {$CCPNROOT}/trunk/all/python'
alias pathb4 'setenv PYTHONPATH {$CCPNROOT}/branch4/all/python'
# CVS command aliases - explained below
alias cvsadd 'python ~/scripts/cvsadd.py \!*'
alias cvsremove 'python ~/scripts/cvsremove.py \!*'
alias cvsupdate 'python ~/scripts/cvsupdate.py \!*'
alias cvscheck 'python ~/scripts/cvscheck.py \!*'
CVS-related comands
All CVS commands call functions in cvsScripts.py, via a short wrapper script. The commands will not overwrite or remove files - depending on the situation they will print a warning and skip the file, or throw an error. Files and directories with certain names (like 'CVS') are ignored, as are files with certain endings (like '.pyc'). The cvscheck command has a separeate set of 'skip files'. See cvsScripts for details.
cvsadd:
- Takes a repName (e.g. 'ccpn', 'ccpnint') and a list of file names, which must must be from
the same directory within the working directory.
- Copies all files to the 'repName' repository, makes a symlink from the old to the new location, and does cvs add on the new files.
- Takes a a list of file names, which must must be symlinks and from the same directory within the working directory.
- Removes each symlink, the file linked to, and does cvs remove on the latter.
- Takes no parameters, but starts from the current directory. If current directory is within a repository (like trunk./cpn) will deal with only this repository. If current directory is within the working directory (like trunk/all) will deal with all repositories.
- Does CVS update, then adds new directories and sumlinks to working directory so taht it accurately reflects the contents of the CVS repository(ies).
cvscheck
- Takes no parameters, but starts from the current directory, which must be within the working directory
- Checks for
1) Files and directories in the working directory that are not symlinks and so potentially should be checked in.
2) Files and directories within the repository directories that are in the CVS (and potentially should be added)