CVS repositories, and how to set them up for using CCPN.
Introduction Problem of people in different locations working on same code Solutions in ‘version management’ code like CVS, SVN The code is stored in one central place CCPN works with several of these ‘repositories’ How can you use and best combine them? See also link at bottom of slides for more details
Directory structure repository_name/ c/c/ data/java/python/ ccpnmr/ ccp/ ccpnmr/ccp/memops/ ccpnmr/ccp/memops/ analysis/ chemElement/chemComp/ clouds/analysis/format/
New code slots in… Even if in different location, retaining the same directory structure makes integration much easier later on Only have to make sure that everyone agrees on organisation and that directory name combinations are unique
Repositories Central CVS repositories Code is developed locally Users ‘commit’ changes to their code when required Central repository stores efforts from all partners Partners ‘check out’ changes made by other partners from central repository to their local directory Allows sharing of all code with minimal effort
Repositories CCPN currently uses two repositories: ccpn/ ‘Lives’ at SourceForge - all LGPL open source code. ccpn_int/ ‘Lives’ at computer in Laue lab, stores code that is not LGPL (e.g. ccpNmr Analysis) Project specific: recoord/, extendNmr/. All have exactly the same directory structure and can be merged easily
Merging ccpn/ python/ ccpnmr/ccp/memops/ format/ ccpn_int/ c/c/ python/ ccpnmr/ analysis/clouds/analysis/
Merging work/ c/c/python/ ccpnmr/ ccp/memops/ analysis/clouds/analysis/format/
Simple CVS Making our own local repository: mkdir testCvs cd testCvs mkdir -p dummy/python mkdir dummy/java mkdir dummy/data cvs -d /testCvs/repository/ init cd dummy cvs -d /testCvs/repository import -m “My repository” myProject vendor tag
Simple CVS Checking out the local repository: cd.. ls repository cvs -d /testCvs/repository checkout myProject ls myProject
Simple CVS At this stage: dummy/ is redundant repository/ contains the central repository files myProject/ contains the local copy of the repository
Simple CVS Adding files to the local copy of the repository: cd myProject/python mkdir myProgram cvs -d /testCvs/repository add myProgram cd myProgram myFile.py cvs -d /testCvs/repository add myFile.py cvs -d /testCvs/repository commit -m “my comments here” myFile.py
Simple CVS Can now check what has changed in repository/ Other developers (with access) can make changes to repository/ as well Need to ‘update’ your local copy so you can ‘get’ the changes made by other developers
Simple CVS Updating your local copy of the repository: cd /myProject cvs update -dP cvs update -dP python/ cvs update -dP python/myProgram/myFile.py
Merging repositories Often have: Local files E.g. some test scripts that are only relevant for you, Python.pyc files, C.o files, … Actual repository files Good practice to keep these separate Avoids accidentally checking in ‘local’ files Clear separation between what is ‘public’ and what is not.
Merging repositories Create a workspace: mkdir workspace cd workspace cvs -d :pserver:ccpn.cvs.sourceforge.net/cvsroot/ccpn checkout -r branch4 ccpn cvs -d /testCvs/repository checkout myProject mkdir all
Merging repositories Download the ‘copyFromRep.py’ script repositories/copyfromrep.py Sets up and maintains your working directory: Will recreate the directory structure found in the repositories Makes symbolic links to the repository files
Merging repositories Have to change the directory names at the top! ccpnRepDirs = (’ /workspace/ccpn', ’ /workspace/myProject') destDir = ’ /workspace/all’
Merging repositories Merge the directories: To see what’s going to happen: python copyFromRep.py test To make the changes: python copyFromRep.py copy
Setting up CCPN To start using the code: setenv CCPNMR_TOP_DIR /workspace/all setenv PYTHONPATH $CCPNMR_TOP_DIR/python:$PYTHONPATH cd /workspace/all/python/memops/scripts_v2/ python makePython.py
Examples and documentation Examples (Python) Documentation $CCPNMR_TOP_DIR/python/doc/api.html $CCPNMR_TOP_DIR/python/ccp/examples $CCPNMR_TOP_DIR/python/ccpnmr/format/examples