CVS for Source Code Revision Management
Group: Wireless Instant Messenger
Kevin Ogden
Nick Hutniak
James Ding
Boldwin Li
Horace Chan
Brian Tsang

Introduction
In any large project, having a source code revision management system will help
to bring the number of headaches down to a more managable level. Our experience in
EE 552 is that CVS allows us to spend our time coding and designing, rather than phoning
and e-mailing each other asking for the latest version of certain files. There has been
an appnote previously written by Paul Somogyi that is an excellent reference by itself.
http://www.ee.ualberta.ca/~elliott/ee552/studentAppNotes/1998f/cvs/
I recommend reading over Paul Somogyi's appnote first, and then reading my appnote. There
are some aspects of CVS that we have not used in our project group, and maybe those aspects
that are covered only in Paul's appnote will be quite useful.
What I have done is post updated information about the CVS system implemented in the CAD
labs that are used in the current EE 552 labs. For example, CVS has been installed and is
available on all the machines, and CVS will run without any fiddling around with the path, etc.
Setting up the environment
Setting up the environment is the only hassle in using CVS, and since it is installed and
ready to use, this hassle is a very small one.
- Decide which member will host the CVS repository. When this is decided, make sure that
each member has read/write/delete (complete access) permissions to this directory. If you
are unsure about how to change permissions, there is a good appnote that can be found at:
http://www.ee.ualberta.ca/~elliott/ee552/studentAppNotes/1998f/unix/shared_afs_directories/
The CVS repository should be a directory that is freshly created (for example, ours was
/ceb531/home/bwli/collaboration
- Each member should edit one of their shell login scripts to automatically set two
environment variables, $CVSROOT and $CVSIGNORE
In our group, we all use the bash shell, so these commands relate to the bash shell.
Open up the ~/.bashrc file in a text editor (the file might not exist yet), and put in
the two following lines.
> export CVSROOT=/ceb531/home/bwli/collaboration
> export CVSIGNORE="*.fsf *.csf *.rpt *.eqn *.pin *.pof *.psf *.sof *.ssf *.quartus *.vwf *.ddb *.cdb *.hdb *.msg *.db_info *.tdb *_info *.ini *.rdb *.BSF *.rdb *.hif *.acf"
The $CVSROOT environment variable points to the CVS repository, so CVS can read/write
as needed. The $CVSIGNORE environment variable specifies which file types that CVS should
ignore. The long list of file types shown above are intermediate files types that Quartus
II likes to create. It was based on experimentation, and is quite accurate for Quartus. For any other tools, you'll have to see which file types to ignore by trial and error.
- On your next login your environment should be setup. If you are anxious and do not want
to logout/login, just execute the .bashrc script at a prompt by typing:
> . .~/.bashrc
Creating the repository
- The hosting member now navigates into the directory where the project files are located (CVS automatically navigate into subdirectories) and import the files:
> cvs import -m "Initial import into CVS" repository_name tag1 tag2
The repository_name is how this particular CVS repository is accessed so choose an easy to type identifier. tag1 and tag2 don't really do too much in a simpler CVS system, so I usually just use the username and project name, just to have something to type in those fields.
Checking out the project
Common operations
Now that each member has the project files checked out, you are ready to work on the files. See,
it wasn't so bad. Some common operations are to checkout the latest files, commit changes
- When you start working on the project, perform a cvs checkout in your home directory. This will get you the latest files
> cvs checkout repository_name
- To add a new file or directory that doesn't exist in the current repository
(directory must be added before adding files):
> cvs add -m "message" file/directory
- To commit your changes to certain files in CVS :
> cvs commit -m "message" file(s)
- To commit all your changes (not usually a good idea since the message will be pretty general and we can't tell what was changed to each file):
> cvs commit -m "message"
Maintainer: James Ding, jjding@ualberta.ca
Last update: 11:29PM on Monday, March 3, 2003