CSC 223 Grinnell College Fall, 2006
 
Software Design
 

The CVS Concurrent Versions System

Summary

This lab provides practice with CVS (a Concurrent Versions System) within the context of the class project.

Background

As the class progresses from the specification and design stages of the various projects to coding, coordination of group efforts becomes particularly important. Specifically, we must work within a system that allows the following:

The CVS Concurrent Versions System

CVS is a version control system designed specifically to address the needs of groups developing software, documentation, and other materials. While some details of CVS may be specific to this version control system, many of the basic ideas apply quite generally. Thus, as students move from this project in this course to other projects either at Grinnell or elsewhere, students are likely to find similar ideas employed in whatever software development system they encounter. Details may differ, but many control systems will have a similar purpose, and developers will finding programming in such environments share common elements.

Resources

Information of CVS (a Concurrent Version System) may be found on-line in three ways:

Steps for this Lab:

  1. Read the Overview of CVS in either on-line system, using http://cvsbook.red-bean.com/cvsbook.html in a browser or the info cvs in a terminal window.

Initialization for Using CVS on MathLAN

Work with CVS requires some initialization and preparation. Thereafter, work follows a relatively simple pattern.

Setup for CVS:

On MathLAN, CVS runs on server cvs.cs.grinnell.edu. While one could include directions to this server with each CVS interaction, work is simplified by placing the a few lines in your file .bash_profile, found in your home directory. The following code is designed for the instructor (username walker).


# Use the CVS repository at cvs.cs.grinnell.edu.

CVSROOT=:pserver:walker@cvs.cs.grinnell.edu:/cvs
export CVSROOT

Steps for this Lab:

  1. Insert the above lines into your .bash_profile file, changing walker to your own username.
  2. After updating .bash_profile, you will either need to log out and back in again or you can run the command
    
    source ~/.bash_profile
    
    from the terminal window you will use in the following steps.

Access to the CVS is password protected. However, once you log in a first time, your account places password information in file .cvspass in your home directory. Since this information is stored in clear text, you should not use your regular password. (For this course, Mr. Stone will assign random passwords to each student. After a first use, you are unlikely to need to remember this detail further.)

  1. Log in to the CVS system by typing the following command in a terminal window:
    
    cvs login
    
    You will be prompted for your password.

With this work done correctly, you will NOT need to use the cvs login command in future interactions.

Getting Started with your CSC 223 Prroject within the CVS System

To use CVS for a project, one project-group member must place the new project into CVS. In the jargon of CVS, the new project is imported into the CVS system.

The following approach is strongly recommended for each CSC 223 project.

Steps for this Lab

  1. Use ArgoUML to generate the main Java class files for your project.

    1. Be sure you have updated the class definitions in ArgoUML, to reflect all use cases and sequence diagrams.
    2. Check that each attribute has the needed type and that each method has the correct signature (parameters, parameter types, and return type).
    3. Save your ArgoUML class diagram(s) into a new, clean directory.
    4. Use the Code Generation option within ArgoUML to create new class files for your project in the new directory.

At this point, you should have a project directory that contains a copy of your ArgoUML class diagram(s) and your newly-created Java class files. This project directory should NOT contain any other files.

Now use these new files as the basis for your project files with CVS.

  1. Within a terminal window, change directory to the newly-created directory from step 5.

  2. Create the new project within CVS with the command:

    
       cvs import -m "project initialization" projname  username start
    

    To clarify this line:

At this point, your system should be entered into CVS. Note, however, that the material in the current directory is not considered to be a CVS working copy of your system. A working copy of the system requires that you check out a current version from CVS. That is the next part of this lab.

Normal Use of CVS

In working with CVS you will want to base your activity at a logical subdirectory. The following commentary assumes you have moved to that subdirectory in a terminal window.

After initial set up, normal use of CVS on MathLAN follows these several steps:

Step Name Command Commentary
Get source files cvs checkout projname Obtain new copies of files for the projname project
Edit yourFile.java cd projname
xemacs yourFile.java
Change directory to the projname project
Start editing your file
Compile/Run Tests jcompile, jrun
Commit changes cvs commit -m "log message about update" yourFile.java Put the new version of yourFile.java back in the repository
Clean up cd ..
cvs release -d projname
y
Move up one directory
check modifications are committed before removing files
verify you want to remove committed files/directories

Use of CVS for this Course

For this course, each group will be responsible for working on its own project. The group will need to determine who will be working with which classes when; that is, project management is left to each group. Please talk with the instructor early and often to clarify these assignments.

While CVS allows any user to revise any file, such flexibility could undermine development of software if one group member were to change the files of another. Further, changes must be controlled, so that software found in the CVS repository represents stable, working code. This leads the following rules for this course:

Using these rules as a base, you should try checking out classes, changing your class(s), committing the change, and cleaning up.

  1. Check out a copy of all classes for your projname project.

  2. Prepare to edit your class, bringing up the file in an editor.

  3. Compile your revised class, correcting any syntactical errors.

  4. Commit your revised class to the repository. (Be sure to commit only your class -- not all classes that you have checked out.)

  5. Clean up your files and directory.

  6. Check out a new version of all classes, and verify that your changes are present.

Work to be Turned In

[In a collaborative effort, one person in a group should import your group's classes into CVS, but this need not be documented directly.]


This document is available on the World Wide Web as
http://www.walker.cs.grinnell.edu/courses/223.fa05/cvs.shtml

created 31 March 2002
last revised 13 October 2005
Valid HTML 4.01! Valid CSS!
For more information, please contact Henry M. Walker at walker@cs.grinnell.edu.