A replacement for the "turnin" program

The venerable Owlnet turnin program has worked well in the past, but now that we're all using a shared Subversion repository, we can use that infrastructure to make it easier to submit project milestones to the teaching staff.

The basic idea is that, once you have checked all your work into the trunk of your repository, you make a copy of it in a subdirectory of the tags directory. Once that copy is checked in, it is considered to be a tag—a snapshot of your work at a single point in time.

Conventions

You can make tags for anything you want; it's often useful to make a tag once you finish some big piece of functionality and have verified that it works. (That way, when you add more stuff on top and break everything, you can easily refer back to "how it was, back before it broke".)

For the purposes of turning in assignments, however, you need to use the following tag names: (these won't be particularly shocking)

Remember, these are the names of directories beneath tags that we'll look inside for your submitted assignment. Maybe an example will help.

Example

Let's say you're turning in your specification. The specification consists of a README (to tell us where everything is), the full spec document (an HTML or PDF file), and any Javadocs you have written (this will probably mean .java stubs and generated .html files).

Here's an example command-line session (think of it as Subversion "pseudocode"). If you have a fancy GUI, you'll be taking similar steps, but it pays to know what's going on under the hood.

# check everything out; you've probably already done this
# if you HAVE already done it, be sure to `svn update` so you can 
# get the new project1 directory structure for your group
$ svn co http://sys.cs.rice.edu/repos/comp314-students
[...]
$ cd comp314-students/projects/project1/group58
$ ls
branches/
tags/
trunk/
$ cd trunk
$ mkdir java ; mkdir docs 
$ emacs README
[...]
$ svn add *
A java
A docs
A README
$ cd java
$ emacs Stub.java
[...]
# oops, better add this too
$ svn add Stub.java
A Stub.java
# maybe you run javadocs, and add those HTML files too
$ cd ../docs
$ emacs spec.html
[...]
$ svn add spec.html
A spec.html
# let's see what we've got queued up
$ cd ..
$ svn status
A docs
A docs/spec.html
A java
A java/Stub.java
A README
# the -m flag lets you specify a (thoughtful!) checkin message right 
# there, instead of invoking your $EDITOR
$ svn commit -m "Commit all the work I'm doing for the spec."
Sending files ...
[...]
Committed revision 1234.
# of course, you probably forgot some stuff, so make more changes and
# commit them freely.  When you're ready to turnin, here's how:
$ cd ..
$ ls
branches/
tags/
trunk/
$ svn up
At revision 1234.
# ask svn to copy your entire 'trunk' to a new directory, 'tags/spec'
# DO NOT just copy all your files into 'tags'; there should be no 
# loose files in that directory, only directories representing copies
# of 'trunk' at various points
$ svn cp trunk tags/spec
A tags/spec
# DO NOT FORGET TO COMMIT!
$ svn commit -m "Tag our specification." tags/spec
[...]
Committed revision 1235.
$ ls tags/
spec/
# You are done!  (You gain one experience point.)
# --------------------
# Or maybe not.  Let's say you just realized you want to change 
# something.  There's still time before the deadline, so you go 
# ahead and make the fix.
# Do it in trunk, not in tags! otherwise there's a good chance you'll
# forget to apply it back to your main codeline.
$ emacs trunk/doc/spec.html
[...]
$ svn commit -m "Last-minute fix to spec." trunk/doc/spec.html
Transmitting files...
Committed revision 1236.
# Now you need to kill the old tag before you make a new one.
$ svn rm tags/spec
D tags/spec
$ svn commit -m "Nuke old spec tag." tags/spec
[...]
Committed revision 1237.
$ svn cp trunk tags/spec
A tags/spec
$ svn commit -m "New spec tag.  And there was much rejoicing." tags/spec
Transmitting files...
Committed revision 1238.

Endurance award

You made it this far? Congratulations, you deserve a break; relax with some useful information about dinosaurs. For more on tagging in Subversion, see the comp314 Subversion document, or section 4 of the SVN book, or consult your local library.