Using the CVS repository for documents on galileo

by Chad Materniak

Introduction

In order to track changes made to important documents produced by the group, these documents should be stored in our Concurrent Versions System (CVS) repository located on galileo. In order to access the CVS repository, you first need login access to galileo. If you don't have login access, or you don't remember your username/password for galileo, then send an email to Bryan Wright and he will help you out.

Installing Software

Before you can work with CVS documents on a Windows machine, you need to install some software. The first thing you need to do is open a web browser and navigate to python.org. Click on "Windows Installer" to download python. Make sure you save the installer in a place where you can find it. After the download finishes, double click the icon to install python. All the default install settings are fine for our purposes, so just hit "next" until all the way through the install application.

Once you get python installed, point your browser toward wincvs.org and click "Download." Download the installer for WinCVS 2.0.9. WinCVS comes packaged in a ZIP file, so you'll have to extract the installers to a directory before you run them.

In the ZIP archive, you'll notice two install applications. You only need to run the installer for WinCVS. The CVSNT installer is invoked automatically by the WinCVS installer. Double click the installer for WinCVS. Again, you can accept all the default settings, i.e. just keep hitting "next" until the program is installed. Should you run into difficulty while installing either WinCVS or CVSNT, restart your computer and run the WinCVS installer again.

Basic WinCVS Usage

For storing documents we really don't need to exploit all the features of CVS. To get started using the system you only need to know a few simple CVS commands.

The rest of this tutorial will get you started using CVS on Windows.

Working with files already on CVS

Now that python and WinCVS are installed, you're ready to start working with CVS documents. Lets start by checking out a project. Fire up WinCVS and select "Remote-->Checkout module..."

In the first field of the dialog box, type in the name of the project on which you wish to work. Under the "Local folder to checkout to:" field, put the path where you'd like to put the directory. Then click the ellipsis for the CVSROOT variable.

This brings up the CVSROOT dialog box. Choose ssh as the protocol and /home/aag/Repository for the repository path. Enter in your username and galileo.phys.virginia.edu for the hostname. I don't recommend entering your password in the password field. Click OK to return to the "Checkout settings" dialog box. Make sure the CVSROOT checkbox is checked and click OK. Enter your galileo password when prompted and the directory will appear (on the desktop, in this case).

Open the directory to examine the files. You can treat these files like any that you might find on a Windows system.

Files come out of CVS as "read only" files. In order to edit a file, you first need to change the permissions. You can do this by right-clicking on the file to edit it's properties and unchecking the "Read-only" checkbox.

Once you're done modifying files, you can commit (i.e. upload) these changes to CVS. Once again, start up WinCVS. Use the Windows Explorer-like interface to find the directory of the project you modified. All CVS directories will show up with a little "swoosh" on them inside the WinCVS program. Right-click the directory you modified and select "Commit..."

Enter an appropriate description of what you modified in the log box and click OK. You'll be prompted for your password on galileo once again. If everything goes smoothly, you'll see "CVS exited normally with code 0" in the python shell window on the bottom of the WinCVS application.

Once you've finished working on a particular project/directory, you need to release it from CVS. The amounts to telling CVS that you're no longer using the files. To release a project/directory, navigate in WinCVS to the directory which contains the CVS directory and click "Admin->Command Line..." to bring up a commandline dialog box.

Inside the commandline text box, type "cvs release -d YourProject" to release the project you checked out from CVS. Make sure the CVSROOT checkbox is check and click OK. You'll be asked for your password and also if its alright to delete that directory. Click "Yes" to delete the directory. If everything went OK the project folder you release will disappear off your desktop.

Adding new files/directories to the CVS repository

Lets start by adding a file to a directory which already exists in CVS. First checkout a project as detailed previously in this tutorial. Put the file you'd like to add to the project in the directory you just checked out from CVS. I suggest using underscores instead of spaces in the file name of any documents you want to put in CVS. Unix has a funny way of dealing with spaces in file names.

Now you need to issue a "cvs add" command to add the file to tell CVS that a new file is being added to this particular directory. Do this by navigating to the directory you checked out in WinCVS, highlighting the appropriate file and clicking "Modify->Add." Be prepared to type your password. Now that CVS knows about the file, you can upload it the the repository using "cvs commit" procedure outlined above.

If you want to add a whole directory to CVS then the best way to do it is usually through a "Tcvs import" command. In the leftmost explorer pain in WinCVS, click on the directory you wish to import, then click "Remote->Import module" You'll be asked a question about scanning for file types. Click "Yes."

Now you should see the CVS imort dialog box. If you did everthing right, you'll see the directory you want to put into the repository in the "Repository path:" text field. You must enter something in the vendor and release tag fields for the import to work. Click the CVSROOT checkbox, enter a description of the files in the log text box, and click OK.

Congratulations you successfully added a project to our CVS repository!