Version Control with Subversion Speaker: Chen-Nien Tsai Adviser: Kai-Wei Ke Date: 2006.01.17.

Slides:



Advertisements
Similar presentations
TortoiseSVN By Group 1 Team B. Installing TortoiseSVN.
Advertisements

Intro to Version Control Have you ever …? Had an application crash and lose ALL of your work Made changes to a file for the worse and wished you could.
1. What is Subversion? Why do we need CM? Basic concepts Repositories Options Setup Clients Options Setup Operation Troubleshooting Slide 2.
Version Control 1.  Version control (or revision control) is the term for the management of source files, and all of the intermediate stages as development.
Software Configuration Management Donna Albino LIS489, December 3, 2014.
1 Using Subversion: Nirav Dave Computer Science & Artificial Intelligence Lab Massachusetts Institute of Technology.
Version Control System Sui Huang, McMaster University Version Control SystemSui Huang, McMaster University Version Control System -- base on Subversion.
Dedi Rahmawan Putra  Shared Document  Conventional Ways  Common Problems  What is TortoiseSVN  Advantages over another tools  Basic Concepts.
David Notkin Autumn 2009 CSE303 Lecture 22 Subversion is an open source version control system. Social Implications Friday version control system.
2/6/2008Prof. Hilfinger CS164 Lecture 71 Version Control Lecture 7.
Using subversion COMP 2400 Prof. Chris GauthierDickey.
Version Control using Subversion Albert Young-Sun Kim November 2 nd, 2005 Available at entations/ subversion/
Source Code Revision Control with Subversion Christophe Dupré May 13, 2005 Update KEJ May 10, 2006 Scientific Computation Research Center Rensselaer Polytechnic.
CS311 – Lecture 08 Outline Subversion (SVN) *All information taken from “SVN Book” O’Reilly Lecture 081CS Operating Systems I.
CS 501 : An Introduction to SCM & GForge An Introduction to SCM & GForge Lin Guo
Low level CASE: Source Code Management. Source Code Management  Also known as Configuration Management  Source Code Managers are tools that: –Archive.
Source Code Management Or Configuration Management: How I learned to Stop Worrying and Hate My Co-workers Less.
Source Control Repositories for Enabling Team Working Svetlin Nakov Telerik Corporation
SubVersioN – the new Central Service at DESY by Marian Gawron.
Version Control Systems and the Subversion Kloimstein Dominik.
Version Control. What is Version Control? Manages file sharing for Concurrent Development Keeps track of changes with Version Control SubVersion (SVN)
Versioning Control Systems
Version Control with git. Version Control Version control is a system that records changes to a file or set of files over time so that you can recall.
Version Control with Subversion. What is Version Control Good For? Maintaining project/file history - so you don’t have to worry about it Managing collaboration.
Source Control Repositories for Team Collaboration: SVN, TFS, Git Svetlin Nakov Telerik Software Academy academy.telerik.com Manager Technical Training.
Subversion. What is Subversion? A Version Control System A successor to CVS and SourceSafe Essentially gives you a tracked, shared file system.
Introduction to Version Control
Source Control Repositories for Team Collaboration: SVN, TFS, Git.
The Design Workshop Introduction to Version Control 1.
Version Control with Subversion Quick Reference of Subversion.
1 Lecture 19 Configuration Management Software Engineering.
Subversion Code Deployment LifeCycle August 2011.
Git – versioning and managing your software L. Grewe.
Subversion (SVN) Tutorial for CS421 Dan Fleck Spring 2010.
Warmup A programmer’s wife tells him, “Would you mind going to the store and picking up a loaf of bread? Also, if they have eggs, get a dozen.” The programmer.
Version control Using Git Version control, using Git1.
Subversion (SVN) Tutorial Source:
Chris Onions Getting started with CVS in ATLAS 11 Getting started with CVS in ATLAS Chris Onions (Tutorial based on that of Raúl Ramos Pollán CERN / IT.
Object-Oriented Analysis & Design Subversion. Contents  Configuration management  The repository  Versioning  Tags  Branches  Subversion 2.
Version Control Menggunakan TortoiseSVN
Subversion (SVN) A Revision Control System Successor to CVS Carlos Armas Hervey Allen.
Introduction to Version Control SE-2030 Dr. Rob Hasker 1 Based on material at and slides written.
Copyright © 2015 – Curt Hill Version Control Systems Why use? What systems? What functions?
Progress with migration to SVN Part3: How to work with g4svn and geant4tags tools. Geant4.
SENG 403 Tutorial 1 1SENG 403 – Winter Agenda Version Control Basics Subversion Basic actions in Subversion Some examples 2SENG 403 – Winter 2012.
Computer Science and Engineering The Ohio State University  Widely used, especially in the opensource community, to track all changes to a project and.
Study for Migration from CVS to SubVersion (SVN) Gunter Folger CERN/PH/SFT.
Version Control with SVN Images from TortoiseSVN documentation
Sabriansyah R.A Version Control. The Repository Subversion adalah sistem tersentralisasi untuk informasi sharing Repository adalah pusat penyimpanan data.
12 CVS Mauro Jaskelioff (originally by Gail Hopkins)
Version Control System
Version Control and SVN ECE 297. Why Do We Need Version Control?
Introduction to Git Yonglei Tao GVSU. Version Control Systems  Also known as Source Code Management systems  Increase your productivity by allowing.
1 CSE 303 Lecture 19 Version control and Subversion ( svn ) slides created by Marty Stepp
(1) Introduction to Subversion (SVN) and Google Project Hosting Philip Johnson Collaborative Software Development Laboratory Information and Computer Sciences.
Subversion (SVN) Tutorial for CS421 Dan Fleck Spring 2010.
Source Control Repositories for Enabling Team Working Doncho Minkov Telerik Corporation
NALINI S. NAUTIYAL SYSTEM SOFTWARE DIVISION Subversion.
Software Testing and Maintenance 1 Subversion  Fundamental Concepts  Basic Usage.
DIGITAL REPOSITORIES CGDD Job Description… Senior Tools Programmer – pulled August 4 th, 2011 from Gamasutra.
1 Subversion Kate Hedstrom April Version Control Software System for managing source files –For groups of people working on the same code –When.
Problem Solving With C++ SVN ( Version Control ) April 2016.
Introduction to Subversion Getting started with svn Matteo Vescovi 19/02/2010.
Source Control Dr. Scott Schaefer. Version Control Systems Allow for maintenance and archiving of multiple versions of code / other files Designed for.
Version Control with Subversion
Source Control Dr. Scott Schaefer.
Version control, using Git
Repository Sally Harry Ira write read read
Subversion.
Concurrent Version Control
Presentation transcript:

Version Control with Subversion Speaker: Chen-Nien Tsai Adviser: Kai-Wei Ke Date:

2006/1/32 Outline Introduction Basic Concepts –Repository –Versioning Models Basic Work Cycle Branch, tag, and Merging Resources Conclusion

2006/1/33 Introduction The Concurrent Versions System (CVS) has long been the tool of choice for version control. Subversion is a relatively new version control system designed to be the successor to CVS. –an open-source system with a design (and “look and feel”) similar to CVS. –attempting to fix most of CVS's noticeable flaws.

2006/1/34 What is Subversion? Subversion is a free/open-source version control system. –Subversion manages files and directories over time. –Files are placed into a central repository. –It allows you to recover older versions of your data, or examine the history of how your data changed (a time machine). –Subversion can access its repository across networks.

2006/1/35 Outline Introduction Basic Concepts –Repository –Versioning Models Basic Work Cycle Branch, tag, and Merging Resources Conclusion

2006/1/36 Repository (1/2) Subversion is a centralized system for sharing information. A repository is a central store of data.

2006/1/37 Repository (2/2) The repository is a kind of file server. The Subversion repository remembers every change ever written to it. –every change to every file. –even changes to the directory tree. The clients can –see only the latest version of the repository. –view previous states of the repository.

2006/1/38 Repository Layout (a common way) Ex. SVN repository – trunk –Main line of development. tags –Contain tag copies. –Some projects name it release. branches –Contain branch copies.

2006/1/39 Repository URLs Subversion repositories can be accessed through many different methods. WebDAV stands for "Web-based Distributed Authoring and Versioning". It is a set of extensions to the HTTP protocol which allows users to collaboratively edit and manage files on remote web servers.

2006/1/310 Versioning Models The core mission of a version control system is to enable collaborative editing and sharing of data. Different systems use different strategies to achieve this. –File-sharing Model –Lock-Modify-Unlock Model –Copy-Modify-Merge Model

2006/1/311 The Problem of File-Sharing Suppose we have two co-workers, Harry and Sally. (When Harry Met Sally) Two users read the same file. They both begin to edit their copies. Harry publishes his version first. Sally accidentally overwrites Harry’s version.

2006/1/312 Two users read the same file

2006/1/313 They both begin to edit their copies

2006/1/314 Harry publishes his version first

2006/1/315 Sally accidentally overwrites Harry’s version Harry's work is effectively lost

2006/1/316 The Lock-Modify-Unlock Solution Harry locks file A, then copies it for editing. While Harry edits, Sally’s lock attempt fails. Harry writes his version, then releases his lock. Now Sally can lock, read, and edit the latest version.

2006/1/317 Harry locks file A, then copies it for editing

2006/1/318 While Harry edits, Sally’s lock attempt fails

2006/1/319 Harry writes his version, then releases his lock

2006/1/320 Now Sally can lock, read, and edit the latest version

2006/1/321 The Problem with the Lock-Modify- Unlock Model Locking may cause administrative problems. –Sometimes Harry will lock a file and then forget about it. Locking may cause unnecessary serialization. –What if they want to edit the different parts of the same file? Locking may create a false sense of security. –Two files edited by different workers may incompatible.

2006/1/322 The Copy-Modify-Merge Solution Subversion, CVS, and other version control systems use a copy-modify-merge model. Each user's client creates a personal working copy. Users then work in parallel, modifying their private copies. The private copies are merged together into a new, final version.

2006/1/323 An Example Two users copy the same file. They both begin to edit their copies. Sally publishes her version first. Harry gets an out-of-date error. Harry compares the latest version to his own. A new merged version is created. The merged version is published. Now both users have each other’s changes.

2006/1/324 Two users copy the same file

2006/1/325 They both begin to edit their copies

2006/1/326 Sally publishes her version first

2006/1/327 Harry gets an out-of-date error Out-of-date

2006/1/328 Harry compares the latest version to his own Merging

2006/1/329 A new merged version is created A miracle? Even a conflict occur?

2006/1/330 The merged version is published

2006/1/331 Now both users have each other’s changes

2006/1/332 Conflicts What if Sally's changes do overlap with Harry's changes? This situation is called a conflict. –The system will notify the user if it happened. –The system can’t automatically resolve conflicts. –The user has to manually resolve it. In practice, conflicts are infrequent.

2006/1/333 Outline Introduction Basic Concepts –Repository –Versioning Models Basic Work Cycle Branch, tag, and Merging Resources Conclusion

2006/1/334 Basic Work Cycle Initial checkout –svn checkout Update your working copy –svn update Commit your changes –svn commit Make changes –svn add, svn delete, svn copy, svn move Examine your changes –svn diff, svn status, svn revert

2006/1/335 Initial Checkout Checking out a repository creates a copy of it on your local machine. This copy contains the HEAD (latest revision) of the Subversion repository. Example –svn checkout tmp]$ svn checkout A Test/trunk A Test/trunk/WSS.h A Test/trunk/WSS.cpp A Test/branches A Test/tags Checked out revision 1.

2006/1/336 Update Your Working Copy Update your working copy to receive any changes made by other developers. Example –svn update trunk]$ svn update U WSS.cpp Updated to revision 2.

2006/1/337 Commit Your Changes Commit your changes to the repository. Example –svn commit --message “log message.” Each time the repository accepts a commit, this creates a new state of the repository, called a revision. trunk]$ svn commit -m “log message" Sending trunk/WSS.cpp Transmitting file data. Committed revision 4.

2006/1/338 Resolve Conflicts If you get a conflict, you need to do one of three things: –Merge the conflicted text “by hand.” –Copy one of the temporary files on top of your working file. –Run svn revert to throw away all of your local changes. Once you've resolved the conflict, you need to let Subversion know by running svn resolved.

2006/1/339 Outline Introduction Basic Concepts –Repository –Versioning Models Basic Work Cycle Branch, tag, and Merging Resources Conclusion

2006/1/340 Branch, tag, and Merging Branch, tag, and merging are concepts common to almost all version control systems. Branch: a line of development that exists independently of another line. Tag: just a snapshot of a project in time. Merging: merge two revisions.

2006/1/341 Why Branch? Suppose you’ve been given the task of performing a reorganization of the project. It will take a long time to write, and will affect all the files in the project. If you start committing your changes bit- by-bit, you'll surely break things for other developers. Solution: create your own branch, or line of development, in the repository.

2006/1/342 Branches

2006/1/343 Branches Creating Branches –A common policy is to place branches in the /project_name/branches directory. –Using svn copy command. Example –svn copy trunk branches/my-branch svn commit –m “message” Test]$ svn copy trunk branches/my-branch A branches/my-branch Test]$ svn commit -m "message" Adding branches/my-branch Adding branches/my-branch/WSS.cpp Committed revision 5.

2006/1/344 Tags (1/2) A tag is just a “snapshot” of a project in time. Creating tags –the same procedure to create a branch –A common policy is to place tags in the /project_name/tags directory. Example –svn copy trunk tags/release-1.0 svn commit –m “message”

2006/1/345 Tags (2/2) Test]$ svn copy trunk tags/release-1.0 A tags/release-1.0 Test]$ svn commit -m "tag" Adding tags/release-1.0 Adding tags/release-1.0/WSS.cpp Committed revision 6.

2006/1/346 Merging To merge all of your branch changes back into the trunk. Example –svn merge -r 5:8 branch trunk]$ svn merge -r 5:8 … U WSS.cpp trunk]$ svn commit -m "after merge" Sending trunk/WSS.cpp Transmitting file data. Committed revision 9.

2006/1/347 Resources Version Control with Subversion (books) – Subversion (the project home) – TortoiseSVN (a subversion client for windows 2k or higher) – ViewCV (a browser interface) –

2006/1/348 ViewVC It is a browser interface for CVS and Subversion version control repositories. It provides the report-like functionality, but much more prettily than the textual command-line program output bin/viewcvs.cgihttp:// /~netlab/cgi- bin/viewcvs.cgi

2006/1/349 Conclusions The heart of any version control system –they are designed to record and track changes to data over time. –to enable collaborative editing and sharing of data. Subversion can manage any sort of file collection—it's not limited to helping computer programmers.

2006/1/350 There are more Repository Administration –How to create a repository? Server Configuration –svnserve server and SSH tunnel. Software Development Policy –Any guideline for committing changes? –When should the trunk become a release (tag)?

Backup Materials

2006/1/352

2006/1/353 Resources Other Browser interfaces –Easy SVN Browser –WebSVN –SVN::Web

2006/1/354 We all have our time machines. Some take us back, they're called memories. Some carry us forward, they're called dreams.

2006/1/355 What is the trunk? The trunk is the central source code that is used for continuous and ongoing development. Trunk builds contain the very latest bleeding-edge changes and updates. However, the trunk can also be very unstable at times, so it's good to ask around before using trunk builds. MozillaZine –

2006/1/356 What is a branch? Branches are "forks" in the code, split from the trunk and destined to become end-user releases. At conception, a branch contains everything that the trunk contains, but from that point onwards, only certain fixes or changes will be accepted. Therefore, over time, the branch becomes more stable. MozillaZine –

CSM CH /6/28 Light-Weight CMMI 57 Configuration Management Use Free Software Tool - CVS –Defining Configuration Items –Define Access & Maintenance Rules –Define Baseline Creation, Release, & Change Rules for Version Control –Record CM activities Dr. Chaw-Kwei Hung 洪肇奎, Light-Weight CMMI.