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
Note that
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).
We have created a personal source code repository (a.k.a. "repo") for you. You can access this repo by two methods:
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:
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:
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.
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:
Download vcutil.h, and create new vcutil.c and makefile. (If you have already created these files elsewhere, just move them here now.)
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 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:
You can find more thorough explanations [ here ]. Also try typing "svn help" and "svn help subcommand ".
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:
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.
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.
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:
cp trunk/cis3090/* tags/cis3090-a1
svn status <--observe "M" flags on the changed files