Electronic submissions via Subversion

You have a subversion repository on this [ server ] (add /svn/ yourlogin to the URL) which requires a login. When it is time to submit your assignment, e.g., A1, copy the files you are submitting into a new tag called cis3090-A1. The instructor only has access to your tags; not to the rest of your repository, which you are hopefully using to backup your source code. When the deadline strikes, a script will check out your tag and copy the latest version of the files. There will only be one attempt. You would be advised to save your work into an An tag as the deadline approaches to avoid being caught without a submission.

Note that mako has the svn command, so you can access your source code conveniently from your SHARCNET account.

Detailed explanation if you need it

NOTE: The explanation below was written for 2750. There will be some spurious mentions about "downloading" files and specific filenames that don't apply here.

NOTE: A Quicktime movie was made several years ago by John Carter for CIS*3110. 3090 is using the same method for assignment submissions.

It is smart to take advantage of this widely-used, free version control system to keep track of your source code all through the course. First, you will have automatic backups which you yourself can recover (without bothering the sysadmin) in the event that you lose files or break your program with modifications. Second, you will be able to submit your assignment with a single command. Third, if for some reason your submission is bungled, we will be able to grab the last version you saved before the deadline. In contrast, if you kept all your files strictly on your own computer, we would not be able to verify that you met the submission deadline.

You can access your files on the SOCS server whether you are working in our lab, using a laptop on campus, or working anywhere in the world (given an Internet connection).

Basic principles of subversion

We have created a personal source code repository (a.k.a. "repo") for you. You can access this repo by two methods:

  • 1. Browse to https://svn.socs.uoguelph.ca/svn/ yourlogin and fill in the popup with your SOCS login. Your repository, consisting of branches, tags, and trunk, will be displayed. Only you--no other student, nor your Instructor--can view it, except for files you choose to submit in tags (explained below). This read-only web interface is primitive, so you won't be using it to submit assignments.
  • 2. Use a subversion client , in particular. the "svn" command. You may also want to install GUI-based clients such as the popular TortoiseSVN. HINT: When you enter a URL in the textbox, make sure it ends with "/" like "...svn/yourlogin/", and don't type "myrepo" from the checkout example below.
  • To begin using subversion, you need to "checkout" your repo. Try this command, substituting your login ID for "student":

    svn checkout https://svn.socs.uoguelph.ca/svn/yourlogin/ myrepo

    Note: The first time you use subversion, you may have to accept a certificate (accept it permanently) and provide your password.

    This will create a directory named "myrepo" and populate it with the three subdirectories you see in the browser view. There is nothing "special" about these directories, which are customary with subversion; they're just names. The use of these subdirectories in SOCS will now be explained:

  • trunk: This is the place where you should do all your software development. A convenient method is to create a subdirectory for each course.
  • tags: This directory is where your Instructor picks up your submissions. You will eventually have a subdirectory for each assignment in each course.
  • branches: You will not need to use this directory in the context of this course.
  • The basic idea of using subversion is that you edit your files as you please. For example, you may create a cis3090 subdir, "cd" to it, then download util.h , and create/edit new util.c , mytest.c , and makefile . When you compile util.c and mytest.c , you'll get util.o and mytest.o , which, linked together, could give a mytest executable. In addition, you might download some test data files.

    Now you have a decision to make: Which files do you want to place under svn's version control? Two logically distinct steps need to be done:

  • 1. Inform svn which directories/files it must keep track of by using an "add" subcommand.
  • 2. Tell svn to copy the files to your remote repository on its server by using the "commit" subcommand.
  • The reason that these steps are separated is because there will be files that you do not want or need to keep under version control, the main example being object files (because these can be regenerated by compiling and linking). Another example is test data files that you downloaded from the course web pages; you can always get those again.

    Your workflow will involve editing the files, recompiling, and testing, until you complete the assignment. Whenever you have achieved a significant milestone, you should commit the new version. This guarantees that you can always return to a previous version if something goes wrong.

    Note: You started with a "check out " (or "co" for short), but "commit" actually provides the corresponding "check in " service. "commit" is abbreviated "ci", if you prefer, meaning check in. If for some reason you want to get rid of your local copy in myrepo, just delete it. The last committed version will remain safe on the server.

    Subversion subcommands

    There are very few svn subcommands that you need to know. You already used "checkout" and don't need to use it again, unless you want to access your repo from another file system.

    The "add" and "commit" subcommands have been mentioned. You could begin your work like this:

    cd myrepo/trunk

    mkdir cis3090

    svn add cis3090

    cd cis3090

    Download vcutil.h, and create new vcutil.c and makefile. (If you have already created these files elsewhere, just move them here now.)

    svn add vcutil.* makefile

    svn commit -m "Creating files for Asmt 1"

    When you "add", svn will print out the files it added flagged with "A". When you "commit", it will print out "Adding... Transmitting file data... Committed revision...". The purpose of the "-m" argument is to let you insert a log message summarizing the commit. If you don't put -m "...", it will bring up a vim editor session to get you to create a message. Best to use -m!

    If you go back to the browser view, you can click on trunk and you will see cis3090 and its files, thus verifying that they are indeed safe in your repo. You can even click on individual files to view their contents. The -m message you typed will appear under "Log message".

    Now, just continue working with your source code, recommitting from time to time. Four other useful subcommands are:

  • status: List which files have been locally modified ("M" flag") that are under version control. Non-controlled files will print with "?" flags, and it will automatically ignore some file types (like .o) altogether.
  • diff: Print out the changes you made to your local files compared with the last committed version in your repo. This is extremely useful when you "broke" your program, but you're not sure what you changed.
  • update: Use update to restore any file to its last-committed state. First, delete your local copy of the file, then type "svn update", and the file will be restored. Of course, you'll lose any local changes, but in this case that may be what you want.
  • revert: If you type an svn subcommand (like "add") in error, you can undo it by using revert, provided you didn't yet do the commit.
  • You can find more thorough explanations [ here ]. Also try typing "svn help" and "svn help subcommand ".

    How to submit

    Submitting an assignment is simply a matter of getting the right files into a subdirectory of myrepo/tags. This is very easy. First, do "svn status" to check for uncommitted changes (flagged with "M" for locally modified), and, if needed, do one final commit of your working, tested source files, then:

    cd myrepo

    svn copy trunk/cis3090 tags/cis3090-a1

    svn commit -m "Submitting 3090 Asmt 1"

    The "copy" subcommand copies all the files of trunk/cis3090--those under version control, along with any others--and adds them in a fresh subdirectory cis3090-a1 of tags. (NOTE: This assumes that you did not already create cis3090-a1. If you did, you'll end up with a copy of cis3090 inside cis3090-a1, which is not what you want.) The copy must also be committed, and only the copies of files under version control (those "added" before) will be sent to the server. Browse to your repository and click on tags to verify that the desired files are really there!

    At the submission deadline, your Instructor will run a script that visits each student's tags, looking for a subdirectory with the right name, in this case, "cis3090-" followed by the assignment number.

    How to re submit

    It is smart to make a working submission well before the deadline, in case something goes wrong (e.g., Internet connection fails). To resubmit prior to the deadline, it is not necessary to reissue the "svn copy" command, since the assignment's tag already exists. Instead, after committing your changes in trunk, just use Linux "cp" to copy any changed files into the tagged subdir, and then recommit. For example:

    cd myrepo

    cp trunk/cis3090/* tags/cis3090-a1

    svn status <--observe "M" flags on the changed files

    svn commit -m "Resubmitting 3090 Asmt 1"

    Gardner Home | Course Home