Centralized Version Control (CVS, Subversion)

Steven J Zeil

Last modified: Sep 21, 2016
Contents:
1 CVS
1.1 History

Centralized Version Control

rcs kept its repository of history information in the “live” working directories.

Centralized version control systems keep a project repository in a location separate from the programmer’s work area.

1 CVS

1.1 History

cvs checkout projectRootDir 

makes a copy of projectRootDir in the working directory, checking out the most recent version of everything in the project.

Similarly,

cd projectRootDir 
cvs commit -m "Added unit tests" 

checks in any changes from the working directory on down.

find . -type f -exec rcsDoSomething {} \;


Where’s the Repository?

The earlier commands presume that we have, somehow, already established a connection with the repository.


Local CVS Repositories

If the repository is on a local file file system,

cvs -d /usr/local/cvsroot checkout myProject/projectRootDir

or record this info in an environment variable:

setenv CVSROOT /usr/local/cvsroot
cvs checkout myProject/projectRootDir


Remote Repositories

The same techniques (-d, CVSROOT) can be used to specify remote repositories.


Connection method: pserver


pserver Exmaple

sirius:~/temp/tmp> setenv CVSROOT :pserver:zeil@cvs.cs.odu.edu:/home/cvs/dlib
sirius:~/temp/tmp> cvs login
Logging in to :pserver:zeil@cvs.cs.odu.edu:2401/home/cvs/dlib
CVS password: *****
sirius:~/temp/tmp> cvs checkout AlgAE
cvs checkout: Updating AlgAE
U AlgAE/.project
U AlgAE/AlgAE_layout.odg
U AlgAE/LICENSE.txt
U AlgAE/README.txt
U AlgAE/build.xml
U AlgAE/buttons.gif
U AlgAE/buttons.odg
U AlgAE/jhbasic.jar
U AlgAE/junit-4.10.jar
cvs checkout: Updating AlgAE/AlgAE_screenshot.png
   ⋮
sirius:~/temp/tmp> ls -ld AlgAE
drwxrwxr-x 11 zeil faculty 1024 Feb 21 13:39 AlgAE/


ssh Connections

If you have ssh access to the machine running the CVS server, you can do

sirius:~/temp/tmp> setenv CVSROOT :extssh:zeil@cvs.cs.odu.edu:/home/cvs/dlib
sirius:~/temp/tmp> cvs checkout AlgAE
The authenticity of host 'cvs.cs.odu.edu (128.82.4.233)' can't be established.
RSA key fingerprint 
   ⋮
Password: 


The History Commands