CVS, or Concurrent Versions System, is a tool used to manage source files during development. It allows you to track changes to your source files, and it simplifies the process of working in teams. In CS 164, CVS will make your life easier when coordinating with your project partner. Plus, the ability to use CVS is a very useful real-world skill to develop, since most software companies use CVS (or something like it).
When you use CVS, the master copies of your source files will be stored in a CVS repository. Each developer checks out a local copy of this repository and makes changes to these files. When you're finished your changes, you check in your files, which updates the repository and makes your changes visible to your fellow programmers.
When other programmers check in their changes, you can tell CVS to merge their changes into your local copies, even if you've made some changes to them that you haven't yet checked in. As long as you aren't modifying the same parts of the same files, this merge process is seamless. (This process might sound a little dicey, but trust us--it works really well.)
To set up CVS for use with CS 164, you need to get a group account where you can store your CVS repository. Both you and your partner will have access to this group account.
If you've already started working on PA4, just rename your current PA4 directory to something else and follow the directions below. Once you've set up your repository and checked out a local copy, move the files you've edited into your new PA4 directory and check them in.
First, fill out the group signup form. Then, add 'cvsgroup cs164-gNN' to the end of your .cshrc on the instructional machines, where NN is your group number.
At home, follow the directions here.
Have one member of your group log on to their instructional account and run 'make-cvs PA4' (or PA4J) in order to create the repository. make-cvs should probably be run from the instructional machines, not from home.
(Outside of 164, you would use 'cvs import'. The CVS documentation describes this process.)
Now, both group members should run 'cvs checkout PA4' (or PA4J) from their own accounts. This command will create a local copy of the repository's contents for each group member.
Now cd into this new directory (which should be called 'PA4' or 'PA4J') and run 'gmake -f ~cs164/assignments/PA4/Makefile source' (or PA4J) as described in the assignment handout, which will set up all the appropriate symbolic links. (The repository you created contains only the files you will edit; this gmake command will set up all of the additional files that you need to compile and run your project.)
Now you're ready to go! Read on to learn more about how to use CVS.
This command retrieves any changes recently committed by others. This is usually
necessary before you can commit your own changes. It is a good idea to
compile the project and, if you are far enough along, run your test cases both before and after doing "cvs
update" so you know whether it was you or the update which broke
something. If you have editted a file and someone else has committed a
change to that file, CVS will attempt to merge your changes together.
The optional -n flag tells CVS to not actually change any of your files.
This is useful for querying the status of the repository.
The -d argument tells cvs to create on your machine any new directories that
somebody might have checked in. By default cvs does not create new
directories. This flag is so useful that many people find it useful to
create a ~/.cvsrc file with one line containing "update -d" in it.
This way you don't have to specify the flag all the time.
If you specify a filename (after cd'ing to the directory containing it),
only that file will be updated, otherwise everything in the current
directory and below is updated. Run this in the top-level project directory
to update the entire project. A useful idiom for undoing all of your changes
to file is "cd dir; rm file; cvs update file".
This command pushes your changes into the repository, so that the next time someone does "cvs update" they will get your changes. You should usually only commit when your code is at least as good as the previous version: it compiles correctly, and it doesn't break the program in a way that will annoy your partner.
If you don't specify a message with -M (or -F), the default editor will open so you can create a log message.
If you specify a filename, only that file will be committed, otherwise everything in the current directory and below is checked in. Run this in the top-level project directory to check all of your changes in.
After you create a file (or directory) called filename, this command adds a
that file to the repository. It isn't visible in the repository
until you do a commit.
The opposite of cvs add.
Shows what changes you've made to filename (or to the whole
repository, if no name is specified) since your last commit, or since version vers.
Shows all of the commits, and the associated log messages, to file filename.
by Jeremy Condit, Matt Harren, and Scott McPeak