Download
version control using subversion svn n.
Skip this Video
Loading SlideShow in 5 Seconds..
Version Control using Subversion (SVN) PowerPoint Presentation
Download Presentation
Version Control using Subversion (SVN)

Version Control using Subversion (SVN)

106 Views Download Presentation
Download Presentation

Version Control using Subversion (SVN)

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

  1. Version Control usingSubversion (SVN) February 29, 2008 David Goldschmidt, Ph.D. Computer Science The College of Saint Rose

  2. also Track Changesin Microsoft Word... Version Control • Version control refers to the managementof multiple versions (a.k.a. revisions)of project-related documents,source code, etc. • Synonyms include: • Revision control • Source control • Source code management

  3. Version Control System • A version control system is crucial to engineering and software development projects • Maintains a centralized repositoryof digital documents • Facilitates organized team-basedcollaboration • Provides revision history forboth individual documentsand groups of documents • Often supports multiple branches of development disadvantage: extra workflow

  4. Version Control Systems • Numerous version control systems are available • Commercial (ranging from $100-$4000+ per user): • ClearCase • Microsoft Visual SourceSafe • Open-source – free: • RCS (Revision Control System) • SCCS (Source Code Control System) • CVS (Concurrent Versions System) • Subversion http://en.wikipedia.org/wiki/Comparison_of_revision_control_software

  5. Architecture of a Version Control System • Centralized repositoryserves multiple clients http://www.zefhemel.com/archives/2005/03/24/isdw-day-4-file-exchange

  6. Subversion • Developed in 2000 and 2001 (by CollabNet, Inc.)to replace CVS and its shortcomings • Subversion is free • Subversion is open-source • Subversion operates across a network • Subversion handles any types of files,documents, or directories • Subversion requires administrativesupport http://svn.collab.net/ http://svnbook.red-bean.com/

  7. Subversion’s Storage Repository • Subversion provides a centralized storage repository • Storage repository acts as a fileserver • Clients connect, thenread from or write to files • Clients can also view logsof changes made to filesor directories • All changes are logged,storing date, time, user responsible, user-specified notes

  8. Problems with Sharing Files • Overwriting changes

  9. Problems with Sharing Files • How can we solve the overwriting changes problem? • Allow a client to lock a file,ensuring only that client canmake changes to the file • Clients can still read the file,but only one client has accessto write the file back to the repository • Key disadvantage: idle developer time spent waiting for write-access

  10. The Copy-Modify-Merge Approach • Subversion uses the copy-modify-merge approach • No locking of files

  11. The Copy-Modify-Merge Approach • Subversion will merge the changes together • Conflicts may arise....

  12. Resolving Conflicts • How are conflicts resolved? • A conflict does not occur ifchanges exist in separate partsof the file • A conflictdoes occur ifchanges overlap • Subversion shows bothversions and allows Harry todecide how to perform the merge

  13. Using Subversion • On its own, Subversion is command-line driven • UNIX: • MS-DOS: • Numerous GUIs have been built on top of SVN • TortoiseSVN • VisualSVN • XCode (Mac OS X) $ svn checkout http://xyz.com:3690/rep ... C:\> svn checkout http://xyz.com:3690/rep ... http://tortoisesvn.net/

  14. TortoiseSVN • TortoiseSVN is • Open-source (free) • Integrated directlyinto Windows Explorer • Usable with any development environment http://tortoisesvn.net/

  15. TortoiseSVN • From Windows Explorer, use TortoiseSVNby right-clicking... • Right-click withina folder or on anindividual file • A context-sensitivemenu with applicableoptions appears

  16. TortoiseSVN: Checking Files Out • Read files from the repository by usingthe checkout command • Connect to the repository using: or include the port number: • Typically checkout the entire trunk to ensureproper compilation • Once checked out, you may modify files,delete files, create new files, etc. svn://srv55z3 svn://srv55z3:3690

  17. TortoiseSVN: Checking Files Out • Read files from the repository by usingthe checkout command • Specify the URLof the repository • Select the localcheckout directory • Specify a revision,if applicable • Also view history logs

  18. TortoiseSVN: Viewing a File’s Status • Windows Explorer shows the status of your files • A checkmark withina green circle indicatesthe file has not beenaltered since checkedout of the repository • An exclamation pointwithin a red circleindicates the file or folder has been modified

  19. TortoiseSVN: Reviewing & Committing Changes • After appropriate changes, deletions, and additions have been made, you may commit your changes • SVN recordsyour changesand associates themwith a new revision number • Update the repositorywith all of your changesby performing a commitfrom the top-level folder

  20. TortoiseSVN: Reviewing Changes • View a diff of the files to be committed

  21. TortoiseSVN: Committing Changes • Describe your changesfor the revision log • Commit fromthe top-level folder • Every change that you commit goes down in history....

  22. TortoiseSVN: Committing Changes • A commit operation is atomic • The new revision number isshown in the resulting dialog box

  23. TortoiseSVN: Importing a New Set of Files • Right-click andselect Importto add a newset of files tothe repository

  24. TortoiseSVN: Importing a New Set of Files • Specify the repository URL, including the name of the subdirectory to create in the repository

  25. TortoiseSVN: Typical Workflows • Update your working copy (i.e. your local repository): • svn update • Change your working copy: • svn add • svn delete • svn copy • svn move • svn mkdir

  26. TortoiseSVN: Typical Workflows • Review your changes: • svn status • svn diff • svn revert (undo) • Resolve conflicts by merging: • svn update • svn resolved • Commit your changes: • svn commit

  27. Additional Recommendations • Usage recommendations: • Avoid storing binary files or JARs • Binary files use a lot of repository space • Avoid storing IDE-specific files • e.g. do not store JDeveloper workspace or project files • Commit changes at meaningful checkpoints • Frequently enough for others toshare in development • Infrequently enough so asnot to create too many revisions

  28. Thank You! • Thank you for yourinterest and attention • Please feel free to e-mail me (goldschd@strose.edu) with additional questions