CIS 300: Introduction to Computer Game Design

CVS Information

CVS, or Concurrent Version Systems, is a type of version management software. You can use it to keep a central version of all your files - code, music, and art - and all edit it at the same time without worrying (too much) about merging your files together.

The basic idea of code management is that you each download a local copy of the project files from the central server. When you want to edit a file, you check it out from the main server. Then when you're done editing (for the time being) you check in all of your changed files and it uploads them to the server. When you upload, you'll be given the chance to put some notes on what you've changed. If you made a mistake, you can easily revert the code on the server to a previous version (hence version management). If, while you had a file checked out, someone else checked out the same file and submitted a new version of it, you will be prompted to merge the files together before submitting yours. You can do this manually, or with software like WinDiff.


CVS Projects for CIS 300

Every group has been assigned a CVS project in CSUG. A CVS project is a single repository where your group can put all of the files that make up your game. This allows you to work on projects collaboratively. Your CVS project is cis300gX where X is the number of your group. So group 1 will use the CVS project cis300g1, and so on.

Below, we have very detailed instructions for using CVS throught Windows. However, if you have a lot of experience with CVS already, you may just want to refer to the CSUG webpage on CVS.


Configuring CVS in CSUG

CVS is already installed in the CSUG (Computer Science Undergraduate) Lab. To use it, start up the program WinCVS. Once you get through the initial menus (you don't have to install Python if you don't want to), go to Admin->Preferences and click on the CVS tab. In the HOME box, enter the directory where SSH is installed (usually C:\Program Files\SSH Communications Security\SSH Secure Shell). Then select the WinCVS tab, and check External diff and enter the path to the WinDiff executable (e.g. C:\windiff\WinDiff.Exe). You may also want to set the Default editor to Visual Studio 2005 (e.g. C:\Program Files\Microsoft Visual Studio 2005\Common7\IDE\devenv.exe). Now click OK.

Next go to Remote->Checkout Module. In Module name and path on the server, enter the codename of your project. Under Local Folder to checkout to, enter the path to the folder where you want all of your code to be. Create a folder inside that folder with the same name as your repository on the server (e.g. orb), and put a file in it (just a text file is fine for now). Then check 'Check out into directory' and you should see your directory name there. Then, under CVSROOT, enter:

:ssh:aaa123@cvs.csuglab.cornell.edu:/cvsroot

where aaa123 should be replaced by your NetID. Hit OK. When CVS prompts, hit Yes. When prompted for a password, enter your NetID password. You should get a reply that CVS exited normally with code 0, and if you browse on the left to the folder that you set as the folder to checkout to, you should see it marked with a checkmark.


Configuring CVS at Home

It is also possible to use CVS on your home computer. To do this, you will need to install the followng software in order.

The last application, WinDiff, does not have an installer, so you should just unzip it into a folder where you would like to keep it. Alternative, if you prefer to use another file differentiation program, feel free to download that. Once you have installed this software, you should follow the same directions as for the CSUG lab.


Using CVS

How to update:

Before you start a coding session, you should always update the files you have locally in case any of your teammates has made a change. To do this, browse to the Top-Level folder on the left where your code is stored, right-click on it, and select Update. You will most of the time want to check, 'Create missing directories that exist in the repository', in case any of your teammates added new folders to the server. Then click OK.

How to add files:

Make sure the files you want to add are in the directory (or a subdirectory) of your checked out directory. If you browse to them in WinCVS you should see them with a question mark inside a sheet of paper. This means they're on your computer, but not on the server. To add them you can either highlight them and click the add button in the toolbar (the one with the red cross inside a sheet of paper), or right-click on them, go to Customize this Menu, and then add, 'Add' and 'Add Binary' to the context menu. You can then just use the right-click context menu from now on. Note that when adding code, you should use 'Add', but when adding things like art or music, you should use 'Add Binary'. When you've done that the files you're adding should have a red piece of paper with an 'A' on them. To commit these changes (and all others), see the section below on comitting.

How to edit current files:

To edit files that are already on the server, highlight them, and either click the edit button in the toolbar (the pencil), or right-click, go to Customize Menu, and add 'Edit' to the menu so you'll be able to use that from now on. When you've done that and modify the file, you should see the paper turn red. To commit all edited and added files, see the next step.

How to commit changes:

To commit all of the changes you've made to the server so other people in your group will get them when they click Update, right-click on the left on your topmost folder and go to Commit. You'll be asked to enter a log message, which should contain a description of the changes you've made, and then go ahead and click ok. Any edited files should change their icons back to normal.

How to merge files:

If you edit a file, and while you're editing it, someone else edits it and commits it, and you try to commit it, you'll get an error from WinCVS that the Up-to-date check failed. In this case, to see the differences between the two versions, you can right-click on the file, go to Diff, check 'Use external diff' and switch the combo box to 'Local copy against another revision...' and hit OK. WinDiff should start and you should be able to see the differences between the two versions. You can then fix your local file to incorporate the changes. To then merge the two versions, right click on that file and click Update. You should see a red piece of paper with a 'C' on it and 'Conflict' under state. If you then open up the file, you should see some formatting- wherever there are changes in the file, you'll see both versions side by side separated by '=' signs. To remove the conflict, you'll have to pick one or some combination of the two versions, and remove any weird formatting, then save. The conflict should then change to 'Resolved' in WinCVS and you'll be able to commit.


There is a lot more to CVS, but that should get you the basics. If you have any questions, you can check out the Help system in the program, or ask a programming TA.