CVS Tutorial

Your project is in the directory nfs/research/fickas/cvsroot on ix.

The project name is CAT, standing for Contextual Awareness Toolkit and it correspond to a subdirectory located in nfs/research/fickas/cvsroot.  As mentioned in class, you must have group permissions to access the CVS projects.  A groupname is being used that all cis610 students should have access to.

Whether you are using CVS on campus or remotely through SSH, you need to have an environment variable that points to the directory that contains your project.  You need to edit your .cshrc file in your ix account by adding the following line: setenv CVSROOT /research/fickas/cvsroot.  This tells CVS where to look when you try to check out your CAT project.

Next, you can change to any directory in your ix account, and do a CVS checkout.  When you perform the CVS checkout the project that you checked out will be transferred to the directory you are currently in.  You can then edit, modify, delete, or add files to you project.  Remember, after you are done making you changes you must do a CVS commit to save your changes to the main CVS directory.

Never heard about CVS?  See this PowerPoint presentation about what CVS is: CVS.ppt

For more information about CVS: http://www.cvshome.org/docs/

For information on WinCVS: http://wincvs.org/index.html and http://wincvs.org/ssh.html 

Examples:

Checking out your project:

ix [~]% cd cis610
ix [~/cis610]% cvs checkout CAT

ix [~/cis610]% cd CAT

ix [~/cis610/CAT]% 

Adding a file to the project:

ix [~/cis610/CAT]% cvs add readme.txt

 

Deleting a file from the project

ix [~/cis610/CAT]% cvs remove readme.txt

 

Committing your changes:

ix [~/cis610/CAT]% cd ..

ix [~/cis610]% cvs commit

 

If you already did a checkout, but are starting to work on the code after a break you can do a update instead of a checkout.  An update is like a checkout, but it will only checkout files that have changed, thus keeping you working version of the project up-to-date.

ix [~/cis610]% cvs update CAT

 

If you have added new files to the project, then CVS will usually want a message for the new files.  When you commit CVS will prompt you for a message for each new file.  You can avoid this by using the -m argument.  You can put anything you want into the quotes.

ix [~/cis610]% cvs commit -m "no message"

 

There are many other commands you can learn, but I have just two more that I'll mention.  If your project is getting very large and you only want to work with a particular file or subdirectory, you can checkout and commit that one file or subdirectory.

ix [~/cis610]% cvs checkout CAT/readme.txt

ix [~/cis610]% cd CAT

ix [~/cis610/CAT]% cvs commit readme.txt

 

You can also add an entire directory to your project at once with the import command.  This is much easier than adding one file at a time.  For example, if you have the iSIM code in a directory called cis610, then with one command you can add all the code to your project.  You need to first be in a directory that contains only the files you want to import.  For example if in cis610, and you type the import command, then all directories and files in cis610 will be imported.  For the import command, you should include a message which can be anything.  Next you must include a valid CVS project name such as tour, which tells CVS where to import the code to.  Then there are two tag arguments, which are can be anything you want; for this example I called them vendor and release.  After the command is executed you will have an iSIM directory inside your tour directory.

ix [~/cis610]% ls

iSIM/

ix [~/cis610]% cvs import -m "no message" CAT vendor release

 

If you wish to place the iSIM directory and all its contents into a different subdirectory, then you just need to add the directory to the destination directory. 

ix [~/cis610]% ls

iSIM/

ix [~/cis610]% cvs import -m "no message" CAT/imported vendor release

 

 

More questions? Email jprideau@cs.uoregon.edu