1 / 36

Version Control Systems and the Subversion

Version Control Systems and the Subversion. Kloimstein Dominik. Overview. Basic information about VCS/Subversion Standard commands of Subversion Branching and Merging. What is a Version Control System?. Standard software update process

Download Presentation

Version Control Systems and the Subversion

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Version Control Systems andthe Subversion Kloimstein Dominik

  2. Overview • Basic informationabout VCS/Subversion • Standard commandsof Subversion • BranchingandMerging

  3. Whatis a Version Control System? • Standard software update process • In generalversion 2.0.11 isdeleted – use 2.0.12 Software xyz Version 2.0.12

  4. Whatis a Version Control System? • Same update processwitharbitraryfiles • Also firsttextfile will beoverriden Textfile x Last change: 10.10.2010 Textfile x Last change: 10.12.2010

  5. Whatis a Version Control System? Textfile x Last change: 10.10.2010 Textfile x Last change: 10.12.2010 User A

  6. Whatis a Version Control System? • Manages all versionsoffilesordirectoriesin thesystem • Subversion is a open source VCS

  7. WhatareRevisions? • Are like versionnumbersoffilesordirectories • Eachchangeof a fileincreasestherevisionnumberby 1 • Subversion givesthewholefilesystem a number • Such a filesystemtreeiscalledrepository

  8. WhatareRevisions?

  9. File sharingproblem

  10. File sharingproblem • Lock-modify-unlocksolution

  11. File sharingproblem • Problems are: • Administration (enoughrightsto lock) • Performance (oneuser must wait) • False sense ofsecurity • Harry works on File A • Sally works on File B • A and B aredepend on eachother

  12. File sharingproblem • Copy-modify-mergesolution

  13. File sharingproblem • Copy-modify-mergesolution

  14. File sharingproblem • Subversion usethecopy-modify-mergemethod • Nowaiting • Problem of so calledconflicts • Same problemwith different results • Overlapingofchanges • Solution: Communication (directtalkorput a flag) • Subversion can also lock files • Necessaryforsoundorgraphicfiles

  15. Repository

  16. Howtoworkwith Subversion • svn [command] [URL] • $ svncheckout http://svn.example.com/repos/calc • URL-forms: • file:/// - directlocalaccess • http:// - accessto a Apache server • https:// - same as http with SSL encryption • svn:// -access to a Subversion server • svn+ssh:// - same assvnthrough SSH tunnel

  17. Howtoworkwith Subversion • file:///C:/svn/repos • file:///svn/repos • file:///localhost/svn/repos • http://svn.example.com/repos • http://svn.example.com:9834/repos

  18. Commands • The mostoftenusedcommandsare: • svnadd URL • svndelete URL • svncopy URL1 URL2 • svnmove URL1 URL2 • svnmkdir URL

  19. Commands • checkout – copyfilestothelocalworkingdirectory $ svn checkout http://svn.example.com/repos/calc A calc/Makefile A calc/integer.c A calc/button.c Checked out revision 1.

  20. Commands • commit – submitoneorseveralfilestotheserver $ svn commit button.c Sending button.c Transmitting file data . Committed revision 57. • Command commitmaybedon‘tchangefiles – solutioncommand update

  21. Commands • update – submitthewholeworkingdirectorytotheserver $ svn update Updating '.': U button.c Updated to revision 58.

  22. Commands • import – import a fileordirectorytotherepository $ svn import /path/to/mytree \ http://svn.example.com/repo/some/project Adding mytree/foo.c Adding mytree/bar.c Adding mytree/subdir Adding mytree/subdir/quux.h Committed revision 59.

  23. Commands • list – showfiles in thegivendirectory $ svn list http://svn.example.com/repo/some/project bar.c foo.c subdir/

  24. Commands • status – show a overviewof all changes • ? item – This item is not underversioncontrol • A item – Scheduledforadditiontotherepository • D item – Scheduledfordeletingthis item in therepository • M item – The content in item ismodified $ svn status ? scratch.c A stuff/loot A stuff/loot/new.c D stuff/old.c M bar.c

  25. Commands $ svn status stuff/fish.c D stuff/fish.c $ svn status -v M 44 23 sally README 44 30 sally INSTALL M 44 20 harry bar.c 44 18 ira stuff 44 35 harry stuff/trout.c D 44 19 ira stuff/fish.c 44 21 sally stuff/things A 0 ? ? stuff/things/bloo.h 44 36 harry stuff/things/gloo.c

  26. Commands • diff – show a overviewof all changes in detail $ svn diff Index: bar.c =================================================================== --- bar.c (revision 3) +++ bar.c (working copy) +#include <sys/types.h> +#include <sys/stat.h> +#include <unistd.h> + +#include <stdio.h> int main(void) { - printf("Sixty-four slices of American Cheese...\n"); + printf("Sixty-five slices of American Cheese...\n"); return 0; } Index: README ...

  27. Commands • log – show a time basedoverviewof all changes in detail $ svn log ------------------------------------------------------------------------ r3 | sally | 2008-05-15 23:09:28 -0500 (Thu, 15 May 2008) | 1 line Added include lines and corrected # of cheese slices. ------------------------------------------------------------------------ r2 | harry | 2008-05-14 18:43:15 -0500 (Wed, 14 May 2008) | 1 line Added main() methods. ------------------------------------------------------------------------ r1 | sally | 2008-05-10 19:50:31 -0500 (Sat, 10 May 2008) | 1 line Initial import ------------------------------------------------------------------------

  28. Commands $ svn log -r 8 -v ------------------------------------------------------------------------ r8 | sally | 2008-05-21 13:19:25 -0500 (Wed, 21 May 2008) | 1 line Changed paths: M /trunk/code/foo.c M /trunk/code/bar.h A /trunk/code/doc/README Frozzled the sub-space winch. ------------------------------------------------------------------------

  29. Commands • cat – returnthecontentof a file $ cat sandwich.txt Top piece of bread Salami Mortadella Prosciutto

  30. Commands • revert – deletechangesandstartfromthebeginning $ cat sandwich.txt Top piece of bread Salami Mortadella Prosciutto Now change Salami to Salad. $ cat sandwich.txt Top piece of bread Salad Mortadella Prosciutto $ svn revert sandwich.txt Reverted 'sandwich.txt‘ $ cat sandwich.txt Top piece of bread Salami Mortadella Prosciutto

  31. Commands $ svn cat -r 2 sandwich.txt Top piece of bread Salad Mortadella Prosciutto

  32. BranchingandMerging • Trunc – isthemaindirectory • Branch – is a copyof a fileordirectoryofthetruncsectionwithsmalldifferences • Tag – is a kindof „snapshot“ of a revision • Merge – isthecombiningoftwobranches (ortocombinethebranch back withthetrunc)

  33. BranchingandMerging

  34. BranchingandMerging • Tag – example $ svn copy http://svn.example.com/repos/calc/trunk \ http://svn.example.com/repos/calc/tags/release-1.0 \ Committed revision 902.

  35. BranchingandMerging • Merge – example $ svn merge --reintegrate ^/calc/branches/my-calc-branch --- Merging differences between repository URLs into '.': U button.c U integer.c U Makefile --- Recording mergeinfo for merge between repository URLs into '.': U . $ svn commit -m "Merge my-calc-branch back into trunk!" Sending . Sending button.c Sending integer.c Sending Makefile Transmitting file data .. Committed revision 391.

  36. BranchingandMerging # Which changes have already been merged from trunk to branch? $ svnmergeinfo ^/calc/trunk r341 r342 r343 … r388 r389 r390 # Which changes are still eligible to merge from trunk to branch? $ svnmergeinfo ^/calc/trunk --show-revs eligible r391 r392 r393 r394 r395 $

More Related