This document explains how to use the Concurrent Versions System (CVS) with the BioCocoa project. To be able to use CVS and contribute code to the BioCocoa project, you will need to have an account at bioinformatics.org, and request to be added to the developer list by the project leader, Peter Schols. You can get more information about the use of CVS with bioinformatics.org projects here.
To upload/export the BioCocoa project into your computer,
open Terminal.app on your machine and make sure that you are using the bash shell by typing bash
at the prompt. Now you can excecute the following commands:
First, set these two shell parameters:
export CVS_RSH='ssh'
export CVSROOT=':ext:loginname@bioinformatics.org:/cvsroot'
(make sure to replace loginname
by your login)
Create a folder on your machine where you want to store the BioCocoa source, e.g.
mkdir ~/Desktop/BioCocoa
Move to that folder, e.g.
cd ~/Desktop/BioCocoa
Move the contents of the CVS repository to that folder:
cvs checkout BioCocoa -P
The entire BioCocoa project will be now be transfered to your local folder. You can monitor what's going on in the Terminal window.
To be able to use CVS transparently in GUI applications, in particular Xcode and CVL, you will need to set up ssh on your machine and on your account at bioinformatics.org, so that you don't need to type your account password everytime you want to use CVS. After setting this up, you will never be asked for your bioinformatics password anymore. This is how GUI applications can run without having to deal with passwords. One other advantage of doing this is that your scripts will be able to run without human intervention. The disadvantage is that anyone who can access your account on your local Mac OS X box will also be able to access those remote servers which have stored your public key.
Open Terminal.app on your machine and type the following commands at the prompt:
ssh-keygen -t dsa
The ssh-keygen process will generate a key pair
Enter file in which to save the key:You can choose the proposed file name and path
Enter passphrase (empty for no passphrase):Just hit return when you are asked for a passphrase
Enter same passphrase again:
Hit return a second time.
Your identification has been saved in /Users/yourlogin/.ssh/id_dsa.
Your public key has been saved in /Users/yourlogin/.ssh/id_dsa.pub.
The key fingerprint is:followed by the key that is generated for your local account.
Note that you could choose to type a password, it does not have to be the
same as your bioinformatics.org password. However, if you type a password, it will
be needed to access your ssh account. This can makes things more complicated,
in particular with CVL. You can always change that password or remove it
(by replacing it with an empty password), using the command ssh-keygen -p
.
Once you have created your private and public keys, you need to place
your public key on the remote host in a place where ssh and scp can
recognize it. For this, add the contents of your local
~/.ssh/id_dsa.pub
file to the file called authorized_keys
in the ~/.ssh
directory in your remote account at bioinformatics.org
(if you don't have such file already, you can create it). You can do this by SFTP'ing to your bioinformatics.org
account and by creating a .ssh
folder in your Home directory and by
adding a authorized_keys
file to this dir.
Another option is to use the Terminal (I have not tested that):
ssh loginname@bioinformatics.org
(make sure to replace loginname
with your bioinformatics login)
cd .ssh
echo '--...copy paste the line from you local ~/.ssh/id_dsa.pub file...--' >> authorized_keys
(the line you have to copy is very long, make sure it is all on one line)
exit
If you are going to access the CVS from different machines, you will have to
add one line per machine, so make sure you are on a new line when adding
another key to the authorized_keys
file.
Add a section on using Subversion here
To be able to use CVS in Xcode, you need to set up a pair of private/public key on your machine and on your account at bioinformatics.org, as described above. Xcode will then be able to connect to the CVS server without asking a password. You can use the built-in SCM support to work on the project and use CVS in Xcode.
To start using CVS in Xcode, double-click the project icon at the top of the 'Groups and Files' view. In the 'General' tab, check the box 'enable SCM' and choose CVS. Click on the edit button to specify to use ssh.
Look into the SCM smart group on the 'Groups and Files' panel on the left. New files and modified files will appear in this group, as indicated by a letter on the left, 'U' for updated (you have an old version), 'M' for modified (you have modified it and may need to commit), 'A' for new files (need to be added first), 'R' for removal, 'C' for conflict,...
The files for the project itself are in the file package 'BioCocoa.pbproj', which contains 'project.pbxproj' and one file per user, e.g. 'username.pbxuser'. The first file is modified every time the project is modified (adding files, changing target settings,...), the second when a user changes her settings. These files will only appear in the 'SCM' smart group, and should be committed to save changes to the project, or the other developers won't have access to the changes.
Things you can NOT do in Xcode, and for which you will have to use another tool (command line or CVL):
As an alternative to Xcode, there are other GUI tools available, including CVL, that you can download from here. The following instructions have been tested with version 3.4.7 (b72).
CVL has instructions to use a remote repository like bioinformatics.org. Here are these instructions:
:ext:username@bioinformatics.org:/cvsroot
(replace username
with... your user name). After clicking OK, CVL will try to connect immediately, and fail,
as we haven't finished configuring it. Don't worry.
/usr/bin/ssh
.Here are the most important items that you will probably use in the menus:
Switch off SCM in Xcode if you want to use CVL. Remember to always close your project in Xcode when you update the project file package itself, as Xcode might otherwise get very confused. Never delete a file in Xcode. Only remove the reference. Then you can mark files for removal and commit using CVL.
This is quite complicated with CVS. Read a CVS manual before doing it if you are not familiar with CVS.
This is not an attempt to write a tutorial for the use of CVS, the reader is referred to the many excellent tutorials that already exist, most of them freely available through the web. And of course 'man cvs' is your friend. However, there are a few useful tips that are listed below. These instructions assume that the user is familiar with the command line.
cvs update -P -d
The -P flag wil prune (remove them from the working copy) empty folders, the -d flag makes sure that new directories added by someone else will also be added to your local repository.
cd MainMenu.nib
In this folder you will find at least three files: info.nib, classes.nib, and keyedobjects.nib. The first two are regular text files, and can be treated by CVS as source code files. However, the keyedobjects.nib file is a binary file, and need some special attention. To update the changes you will need to issue two commands:
cvs update -kb keyedobjects.nib
cvs commit -m "added cool new feature" keyedobjects.nib