User Tools

Site Tools


doc:appunti:prog:cvs

Concurrent Version System (CVS)

In this example we login to an anonymous CVS server and we download the tree of an entire project module.

cvs -d:pserver:anonymous@lirc.cvs.sourceforge.net:/cvsroot/lirc login

The program will prompt for a password and append some information to the ~/.cvspass file.

This command will download the entire lirc directory into the current one:

cvs -z3 -d:pserver:anonymous@lirc.cvs.sourceforge.net:/cvsroot/lirc checkout -P lirc

This command will download a tagged version, named releasebranch_6_3:

CVSROOT=:pserver:grass-guest@intevation.de:/home/grass/grassrepository
cvs -z3 checkout -r releasebranch_6_3 grass6

This command brings the work tree in sync with repository (creating new directories and Pruning empty ones):

cvs update -dP

Questions

  1. How to list the content of the remote server?
  2. How to do a partial download?
  3. How to do a sync?

Committing on SourceForge CVS

We need write access (granted by the project developers), we must use SSH (CVS via SSH) and we need a public ssh key to upload to the SourceForge site. The upload is managed via a web form, into the Account Maintenance page.

checkout

This is an example of authenticated CVS check-out, no password should be requested because authentication is perfomed via ssh key:

export CVS_RSH=ssh
cvs -z3 -d:ext:username@navit.cvs.sourceforge.net:/cvsroot/navit co -P navit
cd navit

diff

A while after the checkout, you can execute a diff to verify your working copy against the repository:

cvs diff

update

If something changed, you can sync your working copy with the repository using the update command:

cvs update
...
cvs update: Updating projs/CodeBlocks/win32gui/resources
cvs update: Updating src
P src/coord.h
P src/projection.h
P src/transform.c
cvs update: Updating src/binding
...

Notice the P that means that a working file was patched to match the repository. If you cange a file in the working copy, the update command will show you that it was modified and not yet committed:

vi po/it.po
cvs update
...
cvs update: Updating po
M it.po
...

Notice the M that means that a file was modified. The update command does not automatically commit your changes to the repository.

commit

Uploading your changes to the repository is done by the commit command. A message describing the change is supplied with the -m option, if option -m is not specified, an editor is started to enter the comment.

cd po/
cvs -z3 commit -m "New Italian translation"
cvs commit: Examining .
Checking in it.po;
/cvsroot/navit/navit/po/it.po,v  <--  it.po
new revision: 1.17; previous revision: 1.16
done
Mailing navit-cvs-commit@lists.sourceforge.net...
Generating notification message...
Generating notification message... done.
doc/appunti/prog/cvs.txt · Last modified: 2008/04/15 09:51 by 127.0.0.1