Subversion.

Slides:



Advertisements
Similar presentations
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.
Advertisements

1. What is Subversion? Why do we need CM? Basic concepts Repositories Options Setup Clients Options Setup Operation Troubleshooting Slide 2.
Version Control System (Sub)Version Control (SVN).
Version Control System Sui Huang, McMaster University Version Control SystemSui Huang, McMaster University Version Control System -- base on Subversion.
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.
Source Control Repositories for Enabling Team Working Svetlin Nakov Telerik Corporation
Subversion Source Code Management System Blair Zajac OrcaWare Consulting August 21, 2002.
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)
Source Code Revision Control Software CVS and Subversion (svn)
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.
1 Topics for this Lecture Software maintenance in general Source control systems (intro to svn)
Subversion. What is Subversion? A Version Control System A successor to CVS and SourceSafe Essentially gives you a tracked, shared file system.
Revision Control and Issue Tracking Andrew Watkins.
Subversion (SVN) Tutorial for CS421 Dan Fleck Spring 2010.
CSCB07 TUT3 TA: Andrey Dyblenko Website:
Object-Oriented Analysis & Design Subversion. Contents  Configuration management  The repository  Versioning  Tags  Branches  Subversion 2.
Subversion (SVN) A Revision Control System Successor to CVS Carlos Armas Hervey Allen.
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.
DireXions – Your Tool Box just got Bigger PxPlus Version Control System Using TortoiseSVN Presented by: Jane Raymond.
CVS – concurrent versions system Network Management Workshop intERlab at AIT Thailand March 11-15, 2008.
Version Control with SVN Images from TortoiseSVN documentation
CVS – concurrent versions system AROC Guatemala July 19-23, 2010 Guatemala City, Guatemala.
Version Control *Slides are modified from Prof. Necula from CS169.
Version Control System
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
Subversion (SVN) Tutorial for CS421 Dan Fleck Spring 2010.
Source Control Repositories for Enabling Team Working Doncho Minkov Telerik Corporation
CS520 Web Programming Version Control with Subversion Chengyu Sun California State University, Los Angeles.
Software Testing and Maintenance 1 Subversion  Fundamental Concepts  Basic Usage.
1 Subversion Kate Hedstrom April Version Control Software System for managing source files –For groups of people working on the same code –When.
Git workflows: using multiple branches for parallel development SE-2800 Dr. Mark L. Hornick 1.
Problem Solving With C++ SVN ( Version Control ) April 2016.
CS491A Software Design Lab Version Control with CVS and Subversion Chengyu Sun California State University, Los Angeles.
Introduction to Subversion Getting started with svn Matteo Vescovi 19/02/2010.
Version Control Using Subversion Tom Hilinski Natural Resource Ecology Laboratory Colorado State University October 2007
Source Control Dr. Scott Schaefer. Version Control Systems Allow for maintenance and archiving of multiple versions of code / other files Designed for.
CS5220 Advanced Topics in Web Programming Version Control with Git
Software Configuration Management CSC-532
Version Control Systems
Version Control with Subversion
CVS – concurrent versions system
11 Version control (part 2)
CVS – concurrent versions system
SVN intro (review).
Source Control Dr. Scott Schaefer.
Subversion Reasons to use How it works Subversion important commands
Version Control with Subversion (SVN)
CSE 303 Concepts and Tools for Software Development
CS5220 Advanced Topics in Web Programming Version Control with Git
Concurrent Version Control
Software Version System Part1: Subversion at CERN
An introduction to version control systems with Git
An introduction to version control systems with Git
An introduction to version control systems with Git
Revision Control Daniel Daugherty
Subclipse CSCI 3130 Summer 2016.
Source Code Control Systems
Subversion Basics Guide
Git CS Fall 2018.
Prof. Hilfinger CS164 Lecture 4
Concurrent Versions System
Systems Analysis and Design I
Version Control 101 with Subversion
Presentation transcript:

Subversion

Subversion: What To Do? Problems of code management in a project The life of the project can be lengthy: need to manage the development history Change of architecture Change of people involved in the development Working in parallel on several versions Maintenance of an old version in parallel with the current version Test of new functionality without an impact to the current version Being able to easily spread change from one version to another Several people involved at the same time in development Working simultaneously on the same code Detect and help to resolve conflicts Family member of Version Control System (VCS) CVS is 1 of the oldest and best known (open source) Subversion (SVN) covers the main concepts while modernising Text and binary, language neutral, not configuration management

The model CVS/SVN repository Working area Working area A B check-out check-out Local copies in working area No "locking": several users may modify different copies of the same file Central repository Database containing all versions (revisions) unique to a single project commit (check-in) Working area B Working area A Synchronisation between the working area and the repository Detection/Resolution of conflicts

SVN: Reference a Repository We specify a repository by its URL Example: https: / / svn.lal.in2p3.fr/projects/Etudiants We call a branch any directory in the repository Matches a directory in the workspace An additional level in the URL Examples: https: / / svn.lal.in2p3.fr/projects/Etudiants/ipn5 https: / / svn.lal.in2p3.fr/projects/Etudiants/ipn5/HelloWorld Wide range of SVN customers Command line: svn Command names generally identical to CVS Web Client: WebSVN Only views the repository https://svn.lal.in2p3.fr/WebSVN

Major Operations checkout update revert info status resolved log add WA R WA WA R checkout update revert info status resolved log add commit

Check-out Creates a local copy (a branch) repository svn co URL Ex : svn co https://svn.lal.in2p3.fr/projects/Enseignement/ens6 Projects R WA % svn co https://svn.lal.in2p3.fr/projects/Etudiants/demo Projects Checked out revision 4. % cd Projets/

Info Lets you know the branch associated with the local directory svn info WA % svn info Path: . URL: https://svn.lal.in2p3.fr/projects/Etudiants/demo Repository UUID: 589c6671-760a-0410-a932-a3fdf8820ca6 Revision: 4 Node Kind: directory Schedule: normal Last Changed Author: jouvin Last Changed Rev: 4 Last Changed Date: 2006-01-17 14:07:34 +0100 (Tue, 17 Jan 2006)

Add Adds file(s) to the repository at the next synchronization svn add file / directory Necessary for any file/directory created after the check-out If directory is selected, treats all contained files and directories R WA % echo "Test" > file1.txt % svn add file1.txt A file1.txt

Status Lets you know the status of the working directory svn status [-u] 1 line per file modified with respect to the repository -u forces verification compared to the repository and not the local copy WA % svn status A file1.txt

Commit Writes local changes to the repository svn ci -m "message" Creates a new revision of the repository containing all the changes Requests a username/password if necessary (ens2006, non-modifiable) Possible only if the workspace is up to date as compared to the repository R WA % svn ci -m 'Ajout de file1.txt' Adding file1.txt Authentication realm: <https://svn.lal.in2p3.fr:443> LAL … Password for 'jouvin': Transmitting file data . Committed revision 5.

Update Imports changes from the repository to the local copy svn update [-r revision] Adds new files (A) or updates others (U) Preserves local changes by doing a merge (G) Indicates conflict: local modification in conflict with a change in the repository (C) In case of conflict, creates several versions of file locally Prevents commits R WA % echo “Personal change” >> file1.txt % svn update C file1.txt  conflit in the file A file2.txt  added file Updated to revision 7. % ls file1.txt file1.txt.r5 file2.txt file1.txt.mine file1.txt.r7

Resolved Indicates that the conflict was resolved svn resolved file Deletes versions created temporarily WA % cp file1.txt.mine file1.txt % svn resolved file1.txt file1.txt file1.txt.mine file1.txt.r5 file1.txt.r7 Resolved conflicted state of 'file1.txt' % ls file1.txt file2.txt

Revert Returns to the version of the repository svn revert file/directory Restores version of the last update. The local changes are lost R WA % cat file1.txt Test Modif perso % svn revert file1.txt Reverted 'file1.txt' 1st modif

Log Lists messages associated with each revision of a file/directory svn log [file/directory] [-v] [--stop-on-copy] Lists only revisions applied to the current branch (file) Includes copy operations between branches, unless --stop-on-copy R asc/jouvin % svn log ------------------------------------------------------------------------ r7 | jouvin | 2006-01-18 22:53:28 +0100 (Wed, 18 Jan 2006) | 1 line Modif 1st file r6 | jouvin | 2006-01-18 22:51:36 +0100 (Wed, 18 Jan 2006) | 1 line Add 2nd file r5 | jouvin | 2006-01-17 14:49:29 +0100 (Tue, 17 Jan 2006) | 1 line Add file1.txt ……

Summary of Major Operations ... check-out : creates a local copy (a branch) repository svn co URL Ex : svn co https://svn.lal.in2p3.fr/projects/Enseignement/ens6 Projects info : lets you know the branch associated with the local directory svn info add : adds file(s) to the repository at the next synchronization svn add file / directory Necessary for any file/directory created after the check-out If directory is selected, treats all contained files and directories status : lets you know the status of the working directory svn status [-u] 1 line per file modified with respect to the repository -u forces verification compared to the repository and not the local copy R WA WA R WA WA

... Summary of Major Operations… commit : writes local changes in the repository svn ci -m "message" Creates a new revision of the repository containing all the changes Requests a username/password if necessary (ens2006, non-modifiable) Possible only if the workspace is up to date as compared to the repository update : imports changes from the repository in the local copy svn update [-r revision] Adds new files (A) or updates others (U) Preserves local changes by doing a merge (G) Indicates conflict: local modification in conflict with a change in the repository (C) In case of conflict, creates several versions of file locally Prevents commits resolved : indicates that the conflict was resolved svn resolved file Deletes versions created temporarily R WA R WA WA

… Summary of Major Operations revert : returns to the version of the repository svn revert file/directory Restores version of the last update. The local changes are lost log : lists messages associated with each revision of a file/directory svn log [file/directory] [-v] [--stop-on-copy] Lists only revisions applied to the current branch (file) Includes copy operations between branches, unless --stop-on-copy R WA R

Operations on Files ... SVN keeps a track of all files renamed, copied, destroyed… Helps to maintain the history even if the file is renamed Reports the revision of the file which resulted in a new file (copy /mv) Manages the creation/deletion/rename of directories No implicit transactions on files Must notify the changes to SVN svn status indicates inconsistencies (!) To simplify, SVN allows to invoke the cp, mv, mkdir… svn cp, mv svn, svn rm, svn mkdir Make SVN forget about a deleted file svn rm --force file

... Operations on Files % svn cp file1.txt file3.txt A file3.txt % ls file1.txt file2.txt file3.txt % svn status A + file3.txt

Advanced Features diff: shows the differences between 2 versions of a file or group of files With the work space: svn diff [-r revision] file/directory Between 2 revisions to the repository: svn diff [-r r1:r2] file/directory Easier with a Web interface (WebSVN, Trac…) WebSVN the LAL: http://svn.lal.in2p3.fr/WebSVN merge: reverts to an earlier revision of the repository svn merge -r HEAD:revision file/directory Does not change the repository but only the local copy (you have to commit to validate a return to the previous revision) update helps to restore an earlier version in the work area but will cause a conflict when committed commit requires that the workspace is up to date with the last revision R WA

To Learn More… Documentation SVN online http://svnbook.red-bean.com/en/1.1/index.html The online help svn help [command]