Using Subversion to Submit Work

This tutorial assumes you are using the command line. Whether you are using a Mac, Linux, or Windows, I highly recommend using the command line. If you need extra help figuring this out or have never used the command line, e-mail Paul Bossi (bossi-at-uchicago.edu) for help; don't be shy!

Introduction

In this class, you will use Subversion (abbreviated SVN) to submit all of your work. We will be using Phoenixforge to manage the SVN repositories associated with the class. Your authentication on Phoenixforge, and the SVN commands that connect to Phoenixforge, will by via your University CNetID and its password. Read this entire document; it contains information about SVN itself, as well as instructions about how you will be using it to submit homework. The easiest way to set this up is to create a directory that you'll work in, such as with:
mkdir ooarch-work
and then
cd ooarch-work
Once you are in ooarch-work or whatever directory you will use to store your code, you run the following command, after replacing "CNetID" with your CNetID and "Qtr" with the three letter quarter code ("spr" for Spring, "sum" for Summer, etc):
svn checkout https://phoenixforge.cs.uchicago.edu/svn/CNetID-mpcs51050-Qtr-14/
OR: svn co ...  (svn co is identical to svn checkout)
From then on you really only need to know three or four SVN commands. You execute these commands from within the directory created by the svn checkout command above. This directory is called your "SVN repository."

Commands

Use
svn add X
for each file X that you want place under SVN's control. Say you write your code in a file called lab1.c. Move the file to your checked-out folder (with name CNetID-mpcs51050-spr-14/). Then, run
svn add lab1.c
from the command line. Now, your file is under version control, and is part of your repository. Next, use
svn commit X
OR: svn ci X    (identical to svn commit, ci means "check-in," for those who like ci/co)
on any file X that has already been added (as above) to push your version of file X to the repository. Every time you commit, you send the committed file to a server (in this case, Phoenixforge). If anyone else uses checkout on that respository, they will be given copies of all files that have been added and committed, using the most recently committed version. The server also keeps all old versions of your files and logs of the changes made by each commit. You can see these logs by typing
svn log -v
An annoying attribute of the commit command is that it will place you into your default command line text editor without telling you why. The reason it does this is to give you a chance to attach a message to the commit. You absolutely should include in this message a description of the changes that come with the commit, for recordkeeping on your and our parts. These messages are part of the svn log output. If you want to change the default command line text editor, you need to change the EDITOR environment variable. If that sounds complicated, I suggest using the -m flag with the commit command as follows:
svn commit -m "your commit message here" X
Use
svn update
to update all files controlled by SVN to their newest versions. If you checkout a copy of a repository in two separate folders, then add, modify, and commit files from one of the folders, you can use this command from within the other folder to update the files in it.

This is the command we will be using to get your work: we will checkout every student's repository and then use the update command once an assignment's deadline has been reached. Then, we will be able to see the most recent version of your submitted assignment and grade it.

We will also place your grades in your SVN repositories. You can use the update command to obtain your grade files once we have committed them. We will notify you when this happens by e-mail. To see if you have local uncommitted changes, use

svn status
or for more information,
svn status -uv
These list files that have uncommitted changes (marked "M" for modified files, "A" for files to be added, and "D" for files to be deleted), and files that have not been added or committed (marked with a "?"), called "untracked" files in SVN.

There are many, many other SVN commands. If you are interested in learning more, feel free to send me an e-mail or read one of the tutorials below.

Submitting MPCS51050 Work

Because svn commit is how you are handing in your work, be careful with it. Its proper use is your responsibility. In particular:

Installing SVN

Further Reading

Here are some links to other (more detailed) SVN informationals:

This tutorial was adapted from Gordon Kindlmann's, which can be found here: http://people.cs.uchicago.edu/~glk/class/scivis/svn.html.