Doing Homeworks with Subversion
Knowing how to use a revision control system is an essential skill for a software developer, and subversion (svn) is one of the more popular systems out there. To develop this skill, we will use subversion throughout the class both for software development, and for homework turn-in.
svn accounts and passwords will be handed out in class. Once you have these credentials, you may proceed to check out your project template from the class repository by running the following command:
svn checkout svn://bits.cs.uic.edu/cs385s11/students/USERNAME --username USERNAME
This is the main project directory, in which you should store all your work. To add a file, create the file in the desired location, then run the command
svn add THEFILE
svn commit THEFILE -m "Added THEFILE for a good reason that I describe here."
this permanently stores this revision of THEFILE in the repository. Later, when you have some files in your directory, and want to store a new version in the repository, you would run "commit" once again, for example:
svn commit -m "Changed function parameters to conform with homework3 parsing requirements."
This automatically commits the current revision of all the tracked files in the current directory. Note that files initially have to be added with "svn add" before revisions can be committed. To check on the status of all the files in your directory, use
which lists all the files that have something unusual about them:
|| Not tracked by repository
|| Local version is newer than repository
given that you will not be sharing a lot of code, these are the main statuses you'll be seeing. Sometimes, when using shared code from the class directories, or if you are writing your code on multiple machines concurrently, you may also encounter:
|| Newer version exists in repository
|| A conflict was detected when updating local version
If you get an "U", all you need to do is run "svn update". A "C" on the other hand means that there is trouble. You will need to first edit the file to find the conflicting parts (marked with ">>>>>>>>"), clear up the confusion, and then run "svn resolved THEFILE" to inform svn that you fixed the problem. Finally, you may want to run "svn commit" to get the newest version into the repository.