digital adj. Having digits.     peer n. A comrade; a companion; a fellow; an associate. inmotion    
   
Recent Articles
Handling a Subversion Repository URL Change
Sunday, May 3, 2009
If your repository URL changes, you can use the following command to fix existing snapshots.
vfat Mounts Default to Lowercase Shortnames
Tuesday, April 21, 2009
I want a "this is brain-damage" quote from Linus for this mess.
VirtualBox or VMWare Virtual Machine at Login
Sunday, April 12, 2009
How to start a virtual machine in X when a user logs in.
Dialog Progress Bar Through Pipe
Sunday, April 12, 2009
How to use dialog to display a script progress bar and communicate progress to it through a named pipe.
Mount JFFS2 Image
Saturday, October 25, 2008
Example of how to mount a JFFS2 image using mtdblock.
Ottawa Linux Symposium 2008
Sunday, July 27, 2008
Here are some pictures from the 2008 Linux Symposium.
Linux Symposium 2008
Sunday, July 20, 2008
I'll be attending the Linux Symposium this year.
Clay Shirky: Institutions vs. collaboration
Monday, July 14, 2008
This is a rather interesting talk that takes some very foundational ideas from open source software development, P2P networks, and social networking and implies that these paradigms can apply to a lot more.

There is no such thing as a boring project. There are only boring executions.
- Irene Etzkorn

Projects-Development...-Using CVS

Using CVS

Thursday, July 8, 2004 by digitalpeer, updated Wednesday, August 18, 2004

CVS is the way to go if you are developing any type of software. Actually, it helps automate a lot of tasks you would otherwise have to do yourself. I used to think it was too much overhead to use something to manage my source, but that's far from true. Anyhow, here are some tips on using CVS and a couple ideas on how I do things.

Getting Started


Create a directory somewhere; preferably somewhere that gets backed up. Set the $CVSROOT environment variable to the path of you just created. It's best to just put this in your .profile, but you can simply run the following for temporary purposes:
export CVSROOT=/path/cvs;

A module is a collection of files as I see it. You can call it a project, a library, or whatever. I will refer to everything as a module as CVS does.

Initialize the repository (this only needs to be done one time and you should never have to do it again):
cvs init

Go into the directory of a project and import it:
cvs import [project] [initials] [tag]

Checkout a module:
cvs co [project]

Update your current working directory with a CVS version (you only need to do this if updates have been made in CVS that are newer than your current working version):
cvs update [project]

Add a file to a module (you'll need to run a commit after this):
cvs add file

Remove a file from a module (if you want cvs to delete the file in the current directory and remove it from the module use the -f option):
cvs remove file
cvs remove -f file

Notice that the -f option comes after remove as it is a parameter to the remove command and not to the cvs command.

Those are the basic commands you'll be using. It is important to note the CVS does not version directories. So, if you delete a directory and then do a commit and checkout the empty directory will be there. To help with this, just use
cvs co -P proj

to purge any empty directories.

Sharing Modules Between Projects


I usually have a group of utilities and libraries I share between projects. This is the best way I've figured out how to successfully share modules between projects.

Add your shared module to CVS just like you would add a new project with import.

Then, checkout the CVSROOT/modules file and add some lines to it:
 cvs co CVSROOT/modules 

This example shows what I usually do for including modules in some of my projects:
utilsa -d src &utils
proj proj &utilsa

This creates an alias for the utils library and then adds it to the project proj. Notice that I included the utils module in the proj src directory. If updates are made to the utils library, they will be committed when you commit the proj module.

Then, check the modules file back in. I'm warning you. You must checkout and checkin the modules file. Don't manually edit it straight in CVSROOT because when you check it in it needs to rebuild some other core CVS files.

Starting Branches


Create a release branch:
cvs co proj
cd proj
cvs tag -b TAG

Checkout a branch:
cvs co -P -r TAG proj

Checking Current Working Version With Old Repository Version


Find out what versions there are in cvs:
cvs log filename

Compare the version we want with the current working version:
cvs diff -r version filename

Another great resources is http://dev.panopticsearch.com/cvs-notes.html

Submit Comment to This Article - Be the first!
Please post a comment if you have something to add, find something wrong, or would like more information on the topic at hand. Do not use the comment form to contact the author about unrelated concerns!

Name: Email (optional):
Enter verification number here: