ì 15#441%Computer%Networks,%Spring%2014%M.Tarek%AbdellaAf%Revision(Control(Revision(Control(ì Before%you%write%a%line%of%code…%ì Use%subversion/CVS/etc.%ì Provides%access%to%all%old%versions%of%your%code%ì No%more%"cp%file.c%file.c.2006#01#01#1059am#oh#god#please#let#this#work"%What(is(revision(control?(ì A%repository%that%stores%each%version%ì You%explicitly%"check%out"%and%"check%in"%code%and%changes.%mabdella:~/tmp> svn checkout https://nsl.qatar.cmu.edu/15441/S13/..... A project1/Makefile A project1/sircd.h ….Why(do(I(want(it?(ì Super#undo:%%Go%to%arbitrary%versions%ì rm%–rf%your%source%tree?%%No%problem!%ì Tracking%changes%/"why%did%this%break?"%ì Concurrent%development%ì Snapshots%ì Turning%in%the%assignment:%%just%make%a%snapshot%when%you%want,%and%we’ll%grade%that.%%You%can%keep%developing%aXerwords.%ì Useful,%e.g.,%for%making%sure%you%have%something%working.%The(repository(ì Master%copy%of%code%is%separate%from%what%you%work%on%ì You%can%have%mulAple%working%copies%checked%out.%(So%can%your%partner)%Repository Your working copy Partner working copy Laptop working copyCheck(out(and(commit(ì Explicitly%synchronize%with%the%repository%Repository Your working copy Checkout / Update CommitFirst Version Older Version 2 Older Version 1 Every(revision(is(available(Current versionConcurrent(Development(ì Each%person%checks%out%a%copy%ì Both%can%work%at%the%same%Ame%without%(much)%fear%of%clobbering%the%other%ì Changes%only%visible%on%commit/update%ì What%if%both%people%edit%the%same%file%and%commit%it?%Concurrent(edits(Ann Drew File v1 Both check out file Edits (ann-1) File v2 Edits (drew-1) Different part of same file commit Update Successfully mergedConcurrent(edits(Ann Drew File v1 Both check out file Edits (ann-1) File v2 Edits (drew-1) Overlap with ann-1 commit Update (CONFLICT)Resolving( Conflicts(ì Subversion%will%give%you%3%files:%ì The%original%with%conflict%markers%ì The%version%you%were%ediAng%ì The%latest%version%in%the%repository%ì You%can:%ì Keep%your%changes,%discarding%others%ì Toss%your%changes%ì Manually%resolve%Branches(ì MulAple%paths%of%development,%e.g.%ì Release%1.0%only%gets%security%patches%ì "Development"%branch%gets%everything%ì "tags"%or%"snapshots"%ì Save%a%good%known%state.%%E.g.,%for%handing%in.%ì Issue%of%merging%(read%on%your%own)%Subversion((see(handout)(ì svn checkout https://nsl.qatar.cmu.edu/... ì svn commit ì svn update ì svn add ì svn mkdir ì svn copy: create a branch or snapshot ì svn diff: See difference between versions by default: between what you started on and where you are nowThoughts(on(Revision(Control(ì Update,%make,%test,%then%commit%ì Update%out%of%habit%before%you%start%ediAng%ì Commit%format%changes%separately%ì Check%svn+diff%before%commidng%ì Try%not%to%break%the%checked%in%copy%ì Don’t%use%svn%lock%ì Avoid%conflicts%by%good%decomposiAon%(modularity)%and%out#of#band%coordinaAon%Go(forth(and(revise!(ì Revision%control%will%save%you%untold%pain%ì Most%people%I%know%have%accidentally%nuked%files%or%enAre%directories%ì Logs%and%diffs%very%useful%for%finding%bugs%ì Much%beger%way%to%coordinate%with%partners%(but%useful%on%your%own!%%I%use%it%for%almost%everything)%ì Very%small%investment%to%learn%ì Try%it%on%your%own!%ì Read%the%SVN%book%online%for%more%info%Reference(ì hgp://svnbook.red#bean.com/%ì Very%very%helpful!!!%ì
View Full Document