CS 580 Client-Server Programming Fall Semester, 2002 CVS |
||
---|---|---|
© 2002, All Rights Reserved, SDSU & Roger Whitney San Diego State University -- This page last updated 12-Sep-02 |
CVS
Concurrent Versions System
Allows multiple users to work on code
Allows access from multiple machines
Rohan doesn’t currently allow remote cvs access from off campus
Manual http://www.cvshome.org/docs/manual/
Windows Version
http://www.wincvs.org/ client
http://www.cvsnt.org/ server
Rohan
On rohan need /usr/local/bin in your path
This seems to be in the default path
Some CVS commands
All examples assume you are using Unix
One Time Only
To store your own files you need a cvs root (repository)
This is created once
Command
cvs -d cvsLocation initExample
cvs -d /home/ma/whitney/cvsRoot init
Where is the Repository?
cvs command need to know the location of the repository
You can
setenv CVSROOT /home/ma/whitney/cvsRootFor other shells you may need to use:
set CVSROOT='/home/ma/whitney/cvsRoot'The examples assume you have set CVSROOT variable
Starting a New ProjectCreate the directory structure for the project
Example
rohan-> mkdir xmlrpcClient rohan-> cd xmlrpcClient/ rohan-> cvs import -m "start assn1" cs580/xmlrpcClient yoyo start No conflicts created by this import Import Command
Creating a shortcut or Module
Remembering cs580/xmlrpcClient is going to be hard so create a short cut or module
Example rohan-> cd .. rohan-> cvs checkout CVSROOT/modules rohan-> cd CVSROOT/ rohan-> ls ~/CVSROOT CVS/ modules rohan 40-> vi modulesAdd the followng line at the end the file
assn1 cs580/xmlrpcClientNow to commit the changes
rohan-> cvs commit -m "Added assn1 module" modules Checking in modules; /home/ma/whitney/cvsRoot/CVSROOT/modules,v <-- modules new revision: 1.6; previous revision: 1.5 done cvs commit: Rebuilding administrative file databasecvs commit updates the repository with all changes in the current project
Now to remove the module files
rohan-> cd .. rohan-> cvs release -d CVSROOT/ You have [0] altered files in this repository. Are you sure you want to release (and delete) directory ´CVSROOT/': ycvs release –d directoryName
Using our assn1 ProjectGetting the Files rohan-> cvs checkout assn1 rohan-> cd assn1 rohan-> ls CVS/cvs checkout moduleName
Adding a new File
Create a file called client.java using an editor
rohan-> cvs add -m "main client file" client.java rohan-> cvs commit -m "added main" cvs commit: Examining . RCS file: /home/ma/whitney/cvsRoot/cs580/xmlrpcClient/client.java,v done Checking in client.java; /home/ma/whitney/cvsRoot/cs580/xmlrpcClient/client.java,v <-- client.java initial revision: 1.1 donecvs add
Making Changes
We can now make more changes to the file
At anytime we can commit the files
rohan-> cvs commit -m "added foobar method" cvs commit: Examining . Checking in client.java; /home/ma/whitney/cvsRoot/cs580/xmlrpcClient/client.java,v <-- client.java new revision: 1.2; previous revision: 1.1 done
Getting the log of Changes
We can view the log of changes made to the project
rohan-> cvs log cvs log: Logging . RCS file: /home/ma/whitney/cvsRoot/cs580/xmlrpcClient/client.java,v Working file: client.java head: 1.2 branch: locks: strict access list: symbolic names: keyword substitution: kv total revisions: 2; selected revisions: 2 description: main client file ---------------------------- revision 1.2 date: 2002/09/12 22:45:17; author: whitney; state: Exp; lines: +2 -0 added foobar method ---------------------------- revision 1.1 date: 2002/09/12 22:44:16; author: whitney; state: Exp; added main
Comparing Files
rohan-> cvs diff -r 1.1 -r 1.2 client.java Index: client.java ============================================ RCS file: /home/ma/whitney/cvsRoot/cs580/xmlrpcClient/client.java,v retrieving revision 1.1 retrieving revision 1.2 diff -r1.1 -r1.2 1a2,3 > // main > // more code
The diff command shows the difference between versions a file
Deleting the local Copy
We can even delete the local copy of the files
This tends to make novices nervous
rohan-> cd .. rohan-> cvs release -d assn1/ You have [0] altered files in this repository. Are you sure you want to release (and delete) directory ´assn1/': y
What is the Point?
So far we have done a lot of work without any benefit
We can get back previous versions!
The -D flag for checkout
We can tell cvs to give us the lasted version of a project before a given time
rohan-> cvs checkout -D yesterday assn1 rohan-> cvs checkout -D "2002-9-11 20:00" assn1 rohan-> cvs checkout -D "2002-9-11" assn1 rohan-> cvs checkout -d "1 hour ago" assn1The –r flag
We can checkout by version number
rohan-> cvs checkout -r 1.1 assn1
More Features
cvs has more features
Read the manual to find out about
The Carrot
The source code in lectures is a available via cvs
On rohan
cvs -d ~whitney/cs580/cvsroot checkout xmlRpcBasic
gives you the code in Doc 2
cvs -d ~whitney/cs580/cvsroot checkout screeningTestCodegives you exam questions and code you can run to test the answers
Copyright ©, All rights reserved.
2002 SDSU & Roger Whitney, 5500 Campanile Drive, San Diego, CA 92182-7700 USA.
OpenContent license defines the copyright on this document.
Previous    visitors since 12-Sep-02    Next