Software Design
Setting Up at Home

Setting Up Cygwin and CVS

Note: this information was written by Chen Jia for the Summer 2003 edition of CSC207. It assumes you are using Windows 2000/XP at home, and the CDF machines at St. George campus at the university. Please send questions, corrections, or suggestions for additions to your instructor.

1: Install Cygwin. You can find details at http://www.cdf.utoronto.ca/workathome/article.php3?id=76. Make sure you install all the packages mentioned in the article.

2: Check that you have CVS Start up Cygwin and type cvs If you see Usage information about CVS then you have installed it already on your machine. The should have been part of your Cygwin installation. In this case skip to step 4. If you get an error saying Command not found try step 3.

3a: Download CVS. You can get it from here.

3b: Install CVS. You will get a zip file from the address above. It should contain an EXE file called cvs-1.11.4.exe. Extract it. If you installed Cygwin in C:\Cygwin, copy that EXE file to C:\Cygwin\bin\cvs.exe. If you installed Cygwin somewhere else, copy the EXE file appropriately.

4: Set environment variables. Right click on "My Computer---Properties". Under the "Advanced" tab, click the "Environment Variables" button. Under "System Variables", click "New" and set two variables (replacing userid with your CDF user ID):

CVSROOT :ext:userid@cdf.utoronto.ca:/u/csc209h/summer/pub/repo/userid
CVS_RSH ssh

5: Check your environment variables. Start a Cygwin shell, then check your environment variables by typing "echo $CVSROOT" and "echo $CVS_RSH". Make sure they have the values you expect.

6: Start using CVS. You should now be able to do the following:

Get a clean copy of the files in your repository.
  1. "cd" to your local folder where you want to store all your CSC209 files.
  2. type "cvs checkout assignments"
  3. When SSH asks for your password, type it.
  4. All the files in your repository will be copied to a local folder with the name assignments.
Upload local changes to files to the master copies in the repository.
  1. Edit Java files on your home machine and debug as you would in the lab. When you want to update some files to CVS, type "cvs update". This will tell what files you have changed by showing you the file's name with an "M" beside it.
  2. If you want to commit these changes to your repository, type "cvs commit". An editor will appear, so that you can enter comments about your changes. When you exit the editor, CVS will commit your changes. You can speed this up by using the "-m" flag to "cvs commit"; see the manual for details.
Work with files on the lab machines.
  1. Log in to CDF, and go to the directory where you have checked out your files.
  2. Type "cvs update". This will refresh the files in your local directory from the repository.
  3. Before you log out, do another update, and then commit any changes you have made, so that you can resume your work at home.
  4. If you change files on the lab machines before doing a "cvs update", and you have checked in changes to those files from home, then when you do "cvs update", you will see the names of the files that you changed in both places with a "C" beside them. You must edit these files and look for sections marked with ">>>>" and "<<<<". These are the places where there are conflicts between the two sets of changes. Edit the file to remove these markers, then do another update, and then commit. You cannot commit while there are still conflict markers in your files.
Work on the lab machines from home using SSH.
You can connect to CDF lab at home by typing "ssh userid@cdf.utoronto.ca". Once you are logged on and do a "ls", you will find out you are in your CDF directory, therefore, you can run your shell programs or gcc and your C program here, and the result will be exact same as you get in the lab. Before you "ssh", make sure you update and commit all your changes in your local computer.

$Id: setup-at-home.html,v 1.1 2005/01/04 21:58:59 reid Exp $