Class Notes (836,586)
Canada (509,861)
CSC207H1 (40)


3 Pages
Unlock Document

Computer Science
Diane Horton

SEPTEMBER 14  How to keep track of changes to your program  Version Control o keep code in a central location = “ repository”  this is the master copy  never directly modify this directory o Create a local copy of the repository in your account at school, on your machine at home, on your laptop o Check out copys to work on  Commit – when the local copy changes, “commit” the changes to the repository  Solve problem 1: tracking changes when working solo o when you get something working, commit the changes o tools aloow you to revert to a previous version o write good log messages so that you don’t have to remember what changed in each version  common svn commands o svn checkout [url] get initial copy  do this anywhere to get a local copy of a repository  tip for assignments: after you commit the version you want us to mark, check out a fresh copy an test it on your school system o svn add [filenames] add new files  notifies subversion that you want it to track the new files  add will almost always be followed by a commit because add doesn’t actually modify the repository o svn status [filenames] see what’s changed  when it says nothing, nothing has been changed  M before file means modified file that is tracked in the repo  A before file means that file is scheduled to be added  ? before file mean the file is not tracked by the repo  C before the file means the file is in conflict w/ file in the repo  D before the file means the file has been deleted locally and is slated for deletion in the repo after committ o svn update [filenames] synchronize with repository  copies stuff from the master repository to your local copy  any commits made by another person or commits done by you from another local copy will be updated in your local copy  does not change the repository  watch the messages closely o svn commit [filenames] commit local changes  copy changes to the repository  will only be allowed if the local copy is up to date o svn remove [filenames] remove files from repository  must first remove the file from the local copy  it is not easy to remove directories  need to commit, just like for add o svn diff [filenames] show diffs between local copy & repo  handy to see what changed btwn versions  dash lines indicate old copy  plus signs indicated working copy, edited file  will report same/differences o svn log [filenames] show history of files  show log message, timestamps and who made the revisions  Magaing concurrency: what if 2 or more people want to edit the same fiel at the same time? o Option 1: prevent it  Only allow one writeable copy of the files, pessimistic concurrency o Option 2: patch up afterwards (Subversion, CVS, Perforce)  Optimistic concurrency, “Easier to get forgiveness than permission” o Optimistic concurrency SEPTEMBER 14  Demo: flavours.txt - file contants listed below at (revision 85) rocky road chocolate toothpaste >>> dhcp0-239:svn-demo dianeh$ svn checkout https://asdf/repository_url/ >>> dhcp0-239:svn-demo dianeh$ ls flavours.txt >>> dhcp0-239:svn-demo dianeh$ svn st // says nothing b/c nothing interesting to report >>> dhcp0-239:svn-demo dianeh$ svn add flavours.txt // tell svn keep track of this file A flavours.txt >>> dhcp0-239:svn-demo dianeh$ svn st // now svn st reports there’s one interesting thing: A flavours.txt // there’s a file marked for addition into the repo // but hasn’t been added to the repo yet >>> dhcp0-239:svn-demo dianeh$ svn commit -m "msg" // commit all changes to the rpo, includes a “msg” Adding flavours.txt Transmitting file data. Committed revision 85. // revision number is repo based, not file based >>> // changes at revision 86: added “lemon meringue” and “roasted marshmallow” line // changes at working copy: appended “!!!!” to “lemon m
More Less

Related notes for CSC207H1

Log In


Join OneClass

Access over 10 million pages of study
documents for 1.3 million courses.

Sign up

Join to view


By registering, I agree to the Terms and Privacy Policies
Already have an account?
Just a few more details

So we can recommend you notes for your school.

Reset Password

Please enter below the email address you registered with and we will send you a link to reset your password.

Add your courses

Get notes from the top students in your class.