CS121 Software Development

CVS Tutorial (Tortoise CVS)

Concurrent Version Control (CVS) is a system for managing project files during development. You create a central repository for your files. Team members can checkout files, modify them, then check them back in. CVS stores your modifed file as the latest version, while preserving the previous one. If need be, you can restore an old version of the file.

Before using CVS, one member of your team should set up the repository. Instructions are provided here.

You can access the CVS repository from your Turing account or from a windows box using Tortoise CVS. These notes describe using CVS on a Windows box. For more info on using CVS from Turing look here. For more information on Tortoise CVS or to download a version look here.

You should keep (at least) your source code and documents under CVS. You probably don't want to keep object and executable files (or visual studio project files) since they are easily recreated and because Tortoise CVS doesn't seem handle these files correctly.



Before using the repository you need to set your ssh preference in tortoise cvs.

	Right click on the desktop then select CVS/Preferences…
	Choose the SSH tab
	Browse to select TortoiseCVS/TortoisePlinkSSH2.exe


You also need to checkout a copy of the repository files. Suppose your project files are in the cvs repository on turing in a directory called proj1. Do the following on the windows machine
	Open the folder where you want the proj1 directory copied.  DO NOT USE THE DESKTOP!
	Right click in this folder and select CVS Checkout ...
	A checkout form will appear.  You should complete it as follows:
	Protocol:  Secure shell
	Server:  turing.cs.hmc.edu
	Repository folder: /cs/cs121/year/semester/teamj/cvsDirectory
	Module: proj1
where year, semester, teamj, and cvsDirectory are specified for your current situation.

Click ok. TortoiseCVS will ask for your password then download the proj1 directory into the current folder.

The following tutorial shows you how to do the basics. For more info refer to the TortoiseCVS user's guide available here.

  1. Add a new file to the repository.

    Create a new Word file test.doc in the proj1 folder on your windows machine.
    Right click on the icon for test.doc and select Add file ...
    Provide your password when requested
    Eventually a dialog box will appear confirming the add was successful.  Click ok to close the box.
    Right click in the proj1 folder and select CVS Commit...
    Provide your password when requested
    Eventually an editor window will appear for you to log your addition.  Type "adding test.doc" and 
        close the window.
    
    The icon for test.doc should change indicating it is now part of the repository.

  2. Modify files.

    Edit test.doc  
    Right click on the test.doc icon and select CVS Commit
    Provide your password when asked  
    Log your changes in the editor when asked
    
    You can commit changes to multiple files at once by right clicking on the proj1 folder and selecting CVS Commit.

  3. Add a new folder to the repository.

    Create a new folder in proj1 called sourceFiles
    Create a file in proj1/sourceFiles called world.h
    Right click on the sourceFiles folder and select CVS Add Contents ...
    Provide your password when requested.
    Eventually a dialog box will appear confirming the add was successful.  Click ok to close
    	the dialog box.
    Right click on the sourceFiles folder and select CVS Commit
    Provide your password when requested
    Eventually an editor window will appear for you to log your addition.  Comment your changes and
    close the editor
    
  4. Updating your local files.

    Suppose your teammate has edited the project files and checked the new versions into the repository. To update your copies, right click in the proj1 folder and select CVS Update. Provide your password when requested.