CVS on Windows Instructions

We'll be using a fictional group:

On ONE account, the one that will be the master repository: (We'll use cs152-alice here.)

  1. Make a batch file and put it in your U: drive containing something like the following:  (A batch file is just a text file with a .bat extension that will run a series of commands).

    set PATH=M:\bin;%Path%

    To use cvs properly you'll need to open a command prompt and from that prompt run the batch file.  It will setup the path properly along with the CVSROOT variable.  Then you can run cvs commands safely.

  2. Create a repository on your account (this should be a directory dedicated entirely to CVS and have nothing in it beforehand).

    mkdir U:\sharedcvs
    cd U:\sharedcvs

    cvs init

  3. Now go find your lab directory:

    cd "U:\foo\bar\lab foo bar"
    cvs import <name of lab> <vendor tag> <vendor branch>

    <name of lab> is the name that you will use to check out your lab.  It can be something mundane like lab3, or something exotic like single_cycle_adventure. <vendor tag> and <vendor branch> are tags and branch ids that are probably meaningless to you unless you know about the tagging and branch options in CVS (RTFM if you need to know more).  All you really need to know about them is that they are required and that they must be alphanumeric, you'll probably never use them again.
  4. If everything works properly notepad should popup giving you a CVS logfile.  Here you can put random information about the files that you just imported.  Save the file and close it.  You should see some messages about files being imported and hopefully it will tell you that there are no conflicts.
  5. Now go to another directory (to check that your import really worked):

    cd u:\baz\boopcvs checkout <name of lab>

    and CVS should check out the lab for you.
  6. Finally to give access to your group members:
    1. Go to your directory by typing it into the navbar of an explorer window. (In this example it would be \\fileservice\cs152\sp04\cs152-alice\sharedcvs)
    2. Open the security tab for that folder.
    3. Add cs152-bob, cs152-chuck, and cs152-doris to the access control list.
    4. Give them full control of your directory and all subfolders and files.
    5. BE VERY CAREFUL WHILE DOING THIS!!!  If you make a mistake and remove yourself from the list then you will lock yourself out of your own directory!  If you didn't give any of your group members full control then they can not give you access again and you will have to talk to Pathma (pathma@cs). I have personally encountered bugs when updating my access control list where I did not explicitly remove myself from the list, I only added one of the other TAs to my ACL and it wiped all the other entries out, leaving me with no access at all (although my fellow TAs could still read it).  If you are going to do this then I'd advise you to give full control to at least one other person so that they can save you if something goes wrong.


On all the OTHER accounts:(cs152-bob, cs152-chuck, cs152-doris)

  1. Make a batch file and put it in your U: drive containing something like the following:

    set PATH=M:\bin;%Path%
    net use v: \\fileservice\cs152\sp04\cs152-alice\sharedcvs

    You'll need to run this every time you open a command prompt to do cvs work
  2. Go to the directory that you want to check out to (u:\foo\bar or c:\temp\foo\bar) and do the following:

    cvs checkout <name of lab>

    And you should get updated properly.

Binary Files

You'll probably want to add binary files to your cvs repository (such as a bitfile) you can do this by using the -kb option (keyword binary) when adding the file to the repository with cvs add. This will prevent cvs from corrupting the file by converting EOL characters into a cannonical form or by performing keyword replacement on the file.

How to Use Keywords

Inside of your source files you can use keyword substitution.  Keyword substitution replaces strings of the form $KEYWORD$ with strings of the form $KEYWORD:value$.  These keywords provide metadata that you can use to identify versions of your files.  You should place them in comments in your source files.

For example: Excerpt from original source file:
// $Header$

Excerpt from keyword-replaced source file:
// $Header: U:\\MY_SPIFFY_REPOSITORY/cvstest/syntest2.v,v 2004/02/28 01:09:48 cs152-tb Exp $

The following  is a list of keywords taken from the CVS manual, you can find the original here.
The following text is Copyright 1999-2002 CollabNet, Inc.


The login name of the user who checked in the revision.


The date and time (UTC) the revision was checked in.


A standard header containing the full pathname of the RCS file, the revision number, the date (UTC), the author, the state, and the locker (if locked). Files will normally never be locked when you use CVS.


Same as $Header$, except that the RCS filename is without a path.


Tag name used to check out this file. The keyword is expanded only if one checks out with an explicit tag name. For example, when running the command cvs co -r first, the keyword expands to `Name: first'.


The login name of the user who locked the revision (empty if not locked, which is the normal case unless cvs admin -l is in use).


The log message supplied during commit, preceded by a header containing the RCS filename, the revision number, the author, and the date (UTC). Existing log messages are not replaced. Instead, the new log message is inserted after $Log:$. Each new line is prefixed with the same string which precedes the $Log keyword. For example, if the file contains:


 /* Here is what people have been up to: 
* $Log: frob.c,v $
 * Revision 1.1 1997/01/03 14:23:51 joe
 * Add the superfrobnicate option

then additional lines which are added when expanding the $Log keyword will be preceded by ` * '. Unlike previous versions of CVS and RCS, the comment leader from the RCS file is not used. The $Log keyword is useful for accumulating a complete change log in a source file, but for several reasons it can be problematic. See section Problems with the $Log$ keyword..


The name of the RCS file without a path.


The revision number assigned to the revision.


The full pathname of the RCS file.


The state assigned to the revision. States can be assigned with cvs admin -s