cvsTalkParis0610

Download Report

Transcript cvsTalkParis0610

CVS repositories,
and how to set them up for using CCPN.
http://www.ccpn.ac.uk:9080/ccpn/projects/extendnmr/working-with-cvs-repositories/
Introduction

Problem of people in different locations working on
same code



CCPN works with several of these ‘repositories’


Solutions in ‘version management’ code like CVS, SVN
The code is stored in one central place
How can you use and best combine them?
See also link at bottom of slides for more details
http://www.ccpn.ac.uk:9080/ccpn/projects/extendnmr/working-with-cvs-repositories/
Directory structure
repository_name/
python/
ccpnmr/
ccp/
java/
analysis/
data/
ccpnmr/
memops/
ccpnmr/
format/
c/
ccp/
ccp/
memops/
analysis/
clouds/
format/
chemComp/
chemElement/
http://www.ccpn.ac.uk:9080/ccpn/projects/extendnmr/working-with-cvs-repositories/
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
http://www.ccpn.ac.uk:9080/ccpn/projects/extendnmr/working-with-cvs-repositories/
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
http://www.ccpn.ac.uk:9080/ccpn/projects/extendnmr/working-with-cvs-repositories/
Repositories

CCPN currently uses two repositories:

ccpn/


ccpn_int/



‘Lives’ at SourceForge - all LGPL open source code.
‘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
http://www.ccpn.ac.uk:9080/ccpn/projects/extendnmr/working-with-cvs-repositories/
Merging
ccpn/
ccpn_int/
python/
ccpnmr/
format/
ccp/
python/
memops/
ccpnmr/
analysis/
clouds/
c/
ccpnmr/
analysis/
http://www.ccpn.ac.uk:9080/ccpn/projects/extendnmr/working-with-cvs-repositories/
Merging
work/
python/
ccpnmr/
format/
ccp/
analysis/
c/
memops/
clouds/
ccpnmr/
analysis/
http://www.ccpn.ac.uk:9080/ccpn/projects/extendnmr/working-with-cvs-repositories/
Simple CVS

Making our own local repository:
mkdir testCvs
cd testCvs
mkdir -p dummy/python
mkdir dummy/java
mkdir dummy/data
cvs -d <full directory path>/testCvs/repository/ init
cd dummy
cvs -d <full path>/testCvs/repository import -m “My
repository” myProject vendor tag
http://www.ccpn.ac.uk:9080/ccpn/projects/extendnmr/working-with-cvs-repositories/
Simple CVS

Checking out the local repository:
cd ..
ls repository
cvs -d <full path>/testCvs/repository checkout myProject
ls myProject
http://www.ccpn.ac.uk:9080/ccpn/projects/extendnmr/working-with-cvs-repositories/
Simple CVS

At this stage:

dummy/ is redundant

repository/ contains the central repository files

myProject/ contains the local copy of the repository
http://www.ccpn.ac.uk:9080/ccpn/projects/extendnmr/working-with-cvs-repositories/
Simple CVS

Adding files to the local copy of the repository:
cd myProject/python
mkdir myProgram
cvs -d <full path>/testCvs/repository add myProgram
cd myProgram
<text editor command> myFile.py
cvs -d <full path>/testCvs/repository add myFile.py
cvs -d <full path>/testCvs/repository commit -m “my
comments here” myFile.py
http://www.ccpn.ac.uk:9080/ccpn/projects/extendnmr/working-with-cvs-repositories/
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
http://www.ccpn.ac.uk:9080/ccpn/projects/extendnmr/working-with-cvs-repositories/
Simple CVS

Updating your local copy of the repository:
cd <full path>/myProject
cvs update -dP
cvs update -dP python/
cvs update -dP python/myProgram/myFile.py
http://www.ccpn.ac.uk:9080/ccpn/projects/extendnmr/working-with-cvs-repositories/
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.
http://www.ccpn.ac.uk:9080/ccpn/projects/extendnmr/working-with-cvs-repositories/
Merging repositories

Create a workspace:
mkdir workspace
cd workspace
cvs -d :pserver:ccpn.cvs.sourceforge.net/cvsroot/ccpn
checkout -r branch4 ccpn
cvs -d <full path>/testCvs/repository checkout
myProject
mkdir all
http://www.ccpn.ac.uk:9080/ccpn/projects/extendnmr/working-with-cvs-repositories/
Merging repositories

Download the ‘copyFromRep.py’ script


http://www.ccpn.ac.uk:9080/ccpn/projects/extendnmr/working-with-cvsrepositories/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
http://www.ccpn.ac.uk:9080/ccpn/projects/extendnmr/working-with-cvs-repositories/
Merging repositories

Have to change the directory names at the top!
ccpnRepDirs = (’<full path>/workspace/ccpn',
’<full path>/workspace/myProject')
destDir = ’<full path>/workspace/all’
http://www.ccpn.ac.uk:9080/ccpn/projects/extendnmr/working-with-cvs-repositories/
Merging repositories

Merge the directories:
To see what’s going to happen:
python copyFromRep.py test
To make the changes:
python copyFromRep.py copy
http://www.ccpn.ac.uk:9080/ccpn/projects/extendnmr/working-with-cvs-repositories/
Setting up CCPN

To start using the code:
setenv CCPNMR_TOP_DIR <full path>/workspace/all
setenv PYTHONPATH $CCPNMR_TOP_DIR/python:$PYTHONPATH
cd <full path>/workspace/all/python/memops/scripts_v2/
python makePython.py
http://www.ccpn.ac.uk:9080/ccpn/projects/extendnmr/working-with-cvs-repositories/
Examples and documentation

Examples (Python)
$CCPNMR_TOP_DIR/python/ccp/examples
$CCPNMR_TOP_DIR/python/ccpnmr/format/examples

Documentation
$CCPNMR_TOP_DIR/python/doc/api.html
http://www.ccpn.ac.uk:9080/ccpn/projects/extendnmr/working-with-cvs-repositories/