telerik_logo_new-(white).png
Software Configuration Management
Source Control Repositories forEnabling Team WorkingSource Control Repositories forEnabling Team Working
Doncho MinkovDoncho Minkov
Telerik CorporationTelerik Corporation
www.telerik.comwww.telerik.com
http://schoolacademy.telerik.com
telerik_logo_new-(white).png
Table of Contents
1.Systems for Software ConfigurationManagement (SCM)1.Systems for Software ConfigurationManagement (SCM)
2.Version Control2.Version Control
Basic notions and principlesBasic notions and principles
3.Versioning Models3.Versioning Models
Lock-Modify-UnlockLock-Modify-Unlock
Copy-Modify-MergeCopy-Modify-Merge
4.Tags and Branching4.Tags and Branching
telerik_logo_new-(white).png
Software Configuration Management (SCM)
Version control  Software ConfigurationManagementVersion control  Software ConfigurationManagement
discipline of the software engineeringdiscipline of the software engineering
Consists of techniques, practices and tools fortheir applicationConsists of techniques, practices and tools fortheir application
Mechanisms for management, control andaccounting of the changes.Mechanisms for management, control andaccounting of the changes.
Defines the process of changeDefines the process of change
Keeps track of what is happening in the projectKeeps track of what is happening in the project
Solves conflicts in the changesSolves conflicts in the changes
telerik_logo_new-(white).png
Why do We Need SCM?
To control the process of softwaredevelopment:To control the process of softwaredevelopment:
Many people working on the same source codeor documentMany people working on the same source codeor document
Concurrent access managementConcurrent access management
Projects with many builds and releasesProjects with many builds and releases
Tracking the evolution of the softwarethroughout the project:Tracking the evolution of the softwarethroughout the project:
Status, progress, defects, functionalityStatus, progress, defects, functionality
telerik_logo_new-(white).png
Advantages of SCM Systems
Control of changesControl of changes
Control over the product development andchangesControl over the product development andchanges
Indicating the progressIndicating the progress
Tracking of the status of the separatecomponents andTracking of the status of the separatecomponents and
Review and auditReview and audit
Possibility of changes reviewingPossibility of changes reviewing
Build controlBuild control
Track the builds and the info about themTrack the builds and the info about them
telerik_logo_new-(white).png
Advantages of SCM Systems (2)
Process controlProcess control
Track the development processTrack the development process
Team workingTeam working
Easier to cooperate with the other teammembersEasier to cooperate with the other teammembers
telerik_logo_new-(white).png
Source CodeSource Code
ModelsModels
BuildBuild
Scripts,Scripts,
FinalFinal
ProductProduct
TextText
ScriptsScripts
and Dataand Data
The FinalThe Final
ProductProduct
RequirementsRequirements
ImplementationImplementation
DesignDesign
ReleaseRelease
TestingTesting
AnalysisAnalysis
ReleaseRelease
SCMSCM
SCM and the Software Development Process
telerik_logo_new-(white).png
The Market of SCM Products
http://wandasworx.com/pages_blog/wp-content/uploads/2008/09/flea-market.jpg
telerik_logo_new-(white).png
The Market of SCM Products
Process-centric software
 configuration management
Software configuration
management (SCM)
Version control
Application life-cycle
management (ALM)
telerik_logo_new-(white).png
Version Control Systems
FunctionalityFunctionality
File versions controlFile versions control
Simple merge and differences searchSimple merge and differences search
BranchingBranching
File lockingFile locking
Console and GUI clientsConsole and GUI clients
Well known productsWell known products
CVS, SubversionCVS, Subversion
Git, MercurialGit, Mercurial
Perforce, TFSPerforce, TFS
telerik_logo_new-(white).png
SCM Systems
FunctionalityFunctionality
Groups of documents controlGroups of documents control
Better merge and differences searchBetter merge and differences search
Work space controlWork space control
Workflow controlWorkflow control
Build and release controlBuild and release control
Well known productsWell known products
Borland StarTeam StandardBorland StarTeam Standard
IBM Rational ClearCaseIBM Rational ClearCase
MKS Source IntegrityMKS Source Integrity
Serena ChangeMan ProfessionalSerena ChangeMan Professional
telerik_logo_new-(white).png
Process-Oriented SCM Systems
FunctionalityFunctionality
Process, Design and implementation templatesProcess, Design and implementation templates
Requirements ControlRequirements Control
Issue trackingIssue tracking
Tasks and task changes controlTasks and task changes control
Permission control (clients, groups, …)Permission control (clients, groups, …)
Analytical tools and progress reportsAnalytical tools and progress reports
Well known productsWell known products
Borland StarTeam StandardBorland StarTeam Standard
IBM Rational ClearCaseIBM Rational ClearCase
MKS Source IntegrityMKS Source Integrity
telerik_logo_new-(white).png
Application Lifecycle Management (ALM) Systems
FunctionalityFunctionality
Close integration of processes with the tools fortheir usageClose integration of processes with the tools fortheir usage
Design toolsDesign tools
Development toolsDevelopment tools
Testing toolsTesting tools
Project control toolsProject control tools
Better known productsBetter known products
Microsoft Visual Studio Team System ServerMicrosoft Visual Studio Team System Server
Borland StarTeam Enterprise AdvantageBorland StarTeam Enterprise Advantage
Telelogic SYNERGYTelelogic SYNERGY
http://www.nwcadence.com/images/alm.png
telerik_logo_new-(white).png
Version Control
Managing Different Version of theManaging Different Version of the
Same File (Document)Same File (Document)
http://im.videosearch.rediff.com/thumbImage/videoImages/videoImages1/blip/rdhash791/Jpalardy-TakingControlOfTheCommandline997.jpg
telerik_logo_new-(white).png
Version Control
Constantly used in software engineeringConstantly used in software engineering
While working with documentsWhile working with documents
During software developmentDuring software development
Changes are identified with an increment ofthe serial numberChanges are identified with an increment ofthe serial number
“version number”for example 1.0, 2.0, 2.17“version number”for example 1.0, 2.0, 2.17
Version numbers are historically linked withthe person who created themVersion numbers are historically linked withthe person who created them
telerik_logo_new-(white).png
Change Log
Systems for version control keep completechange logSystems for version control keep completechange log
The date and hour of every change is storedThe date and hour of every change is stored
The user who made the change is storedThe user who made the change is stored
Old versions can be retrieved, examined andcomparedOld versions can be retrieved, examined andcompared
It is possible to return to an old version(revert)It is possible to return to an old version(revert)
telerik_logo_new-(white).png
Vocabulary
RepositoryRepository
server that stores the files (documents)server that stores the files (documents)
Keeps change logKeeps change log
Revision, VersionRevision, Version
Individual version (state) of document that isresult of multiple changesIndividual version (state) of document that isresult of multiple changes
Check-outCheck-out
Retrieves working copy of the files from therepository into local directoryRetrieves working copy of the files from therepository into local directory
It is possible to lock the filesIt is possible to lock the files
telerik_logo_new-(white).png
Vocabulary (2)
ChangeChange
modification to local file (document) that isunder version controlmodification to local file (document) that isunder version control
Change ListChange List
set of changes to multiple files that aregoing to be committed at the same timeset of changes to multiple files that aregoing to be committed at the same time
Commit, Check-inCommit, Check-in
Applying the changes made on the work copyto the files in the repositoryApplying the changes made on the work copyto the files in the repository
Automatically creates new versionAutomatically creates new version
Conflicts may occur!Conflicts may occur!
telerik_logo_new-(white).png
Vocabulary (3)
ConflictConflict
The simultaneous change to file by multipleusersThe simultaneous change to file by multipleusers
Automatic and manual solvingAutomatic and manual solving
UpdateGet Latest VersionUpdateGet Latest Version
Checking-out the changed files from therepository to local directoryChecking-out the changed files from therepository to local directory
Undo Check-outUndo Check-out
Cancels the changes to group of filesCancels the changes to group of files
Restores their state from the repositoryRestores their state from the repository
telerik_logo_new-(white).png
Vocabulary (4)
MergeMerge
Combining the changes to file simultaneouslymade by different usersCombining the changes to file simultaneouslymade by different users
Can be automated in most casesCan be automated in most cases
LabelTagLabelTag
Labels mark with name group of files in agiven versionLabels mark with name group of files in agiven version
For example releaseFor example release
BranchingBranching
Division of the repositories in number ofseparate work flowsDivision of the repositories in number ofseparate work flows
telerik_logo_new-(white).png
Version Control: Typical Scenario
UsersUsers
RepositoryRepository
MainMain
developmentdevelopment
lineline
User AUser A
User BUser B
Version BranchVersion Branch
Version BranchVersion Branch
Version A.1 BranchVersion A.1 Branch
Check OutCheck Out
AA
Check OutCheck Out
BB
MergeMerge
DD
Check InCheck In
CC
Check InCheck In
EE
telerik_logo_new-(white).png
Versioning Models
Lock-Modify-Unlock andCopy-Modify-MergeLock-Modify-Unlock andCopy-Modify-Merge
telerik_logo_new-(white).png
Versioning Models
Lock-Modify-Unlock:Lock-Modify-Unlock:
Only one user works on given file at time no conflictsOnly one user works on given file at time no conflicts
Example: Visual SourceSafeExample: Visual SourceSafe
Copy-Modify-Merge:Copy-Modify-Merge:
Users make parallel changes to their ownworking copiesUsers make parallel changes to their ownworking copies
The parallel changes are merged and the finalversion emergesThe parallel changes are merged and the finalversion emerges
Examples: CVS, SubversionExamples: CVS, Subversion
telerik_logo_new-(white).png
Locking Problems
Administrative problems:Administrative problems:
Someone locks given file and forgets about itSomeone locks given file and forgets about it
Time is lost while waiting for someone torelease fileTime is lost while waiting for someone torelease file
Unneeded locking of the whole timeUnneeded locking of the whole time
Different changes are not necessary in conflictDifferent changes are not necessary in conflict
ExampleAndy works on the begging of the fileand Bobby works on the endExampleAndy works on the begging of the fileand Bobby works on the end
telerik_logo_new-(white).png
Merging Problems
If given file is concurrently modified it isnecessary to merge the changesIf given file is concurrently modified it isnecessary to merge the changes
Merging is hard!Merging is hard!
It is not always possible to do it automaticallyIt is not always possible to do it automatically
Responsibility and coordination between thedevelopers is neededResponsibility and coordination between thedevelopers is needed
Commit as fast as you canCommit as fast as you can
Do not commit code that does not compile orblocks the work of the othersDo not commit code that does not compile orblocks the work of the others
Add comments on commitAdd comments on commit
telerik_logo_new-(white).png
File Comparison / Merge
During manual merge use file comparisonDuring manual merge use file comparison
There are visual comparison merge tools:There are visual comparison merge tools:
TortoiseMergeTortoiseMerge
WinDiffWinDiff
AraxisMergeAraxisMerge
BeyondCompareBeyondCompare
CompareItCompareIt
telerik_logo_new-(white).png
File Comparison – Example
TortoiseMerge showing two file diff
telerik_logo_new-(white).png
The"Lock-Modify-Unlock" Model
http://www.iconarchive.com/icons/aha-soft/software/256/key-icon.png
telerik_logo_new-(white).png
MCj04114760000[1]
The Lock-Modify-Unlock model (1)
RepositoryRepository
BD18200_
A
BD18200_
A
Andy and Bobbycheck-out file A.Andy and Bobbycheck-out file A.
The check-out is donewithout locking. Theyjust get local copy.The check-out is donewithout locking. Theyjust get local copy.
UpdateUpdate
MCj03871500000[1]
BD18200_
A
UpdateUpdate
Andy
Bobby
telerik_logo_new-(white).png
MCj04114760000[1]
The Lock-Modify-Unlock model (2)
RepositoryRepository
BD18200_
A
BD18200_
Аndy
Andy locks file andbegins modifying it.Andy locks file andbegins modifying it.
LockLock
MCj03871500000[1]
BD18200_
A
Andy
Bobby
(Local Edit)(Local Edit)
http://animalcrazekids.com/images/lock-security-icon.png
telerik_logo_new-(white).png
MCj04114760000[1]
The Lock-Modify-Unlock model (3)
RepositoryRepository
BD18200_
A
BD18200_
Andy
Bobby tries to lock thefile too, but she can’t.Bobby tries to lock thefile too, but she can’t.
Bobby waits for Andy tofinish and unlock the file.Bobby waits for Andy tofinish and unlock the file.
MCj03871500000[1]
BD18200_
A
WaitWait
Andy
Bobby
http://animalcrazekids.com/images/lock-security-icon.png
http://www.bits4beats.it/wp-content/uploads/2010/07/chronometer.png
telerik_logo_new-(white).png
MCj04114760000[1]
The Lock-Modify-Unlock model (4)
RepositoryRepository
BD18200_
BD18200_
Andy
Andy commits thechanges and unlocksthe file.Andy commits thechanges and unlocksthe file.
CommitCommit
MCj03871500000[1]
BD18200_
Andy
Andy
Andy
Bobby
telerik_logo_new-(white).png
MCj04114760000[1]
The Lock-Modify-Unlock model (5)
RepositoryRepository
BD18200_
BD18200_
Andy
Now Bobby can take themodified file and lock it.Now Bobby can take themodified file and lock it.
Bobby edits her localcopy of the file.Bobby edits her localcopy of the file.
MCj03871500000[1]
BD18200_
LockLock
Andy
Andy
Andy
Bobby
http://animalcrazekids.com/images/lock-security-icon.png
(Local Edit)(Local Edit)
telerik_logo_new-(white).png
MCj04114760000[1]
The Lock-Modify-Unlock model (6)
RepositoryRepository
BD18200_
BD18200_
Andy
Bobby finishes,commits her changesand unlocks the file.Bobby finishes,commits her changesand unlocks the file.
MCj03871500000[1]
BD18200_
CommitCommit
Andy
Bobby
Andy
Bobby
Andy
Bobby
telerik_logo_new-(white).png
MCj04114760000[1]
The Lock-Modify-Unlock model (7)
RepositoryRepository
BD18200_
BD18200_
Andy
Bobby
Andy updates thechanges from therepository.Andy updates thechanges from therepository.
MCj03871500000[1]
BD18200_
Andy
Bobby
Andy
Bobby
UpdateUpdate
Andy
Bobby
telerik_logo_new-(white).png
The"Copy-Modify-Merge" Model
ImageFigure 5Workflow in a VCS utilizing optimistic versioning
telerik_logo_new-(white).png
MCj04114760000[1]
The Copy-Modify-Merge Model (1)
RepositoryRepository
BD18200_
A
BD18200_
A
Andy and Bobbycheck-out the file A.Andy and Bobbycheck-out the file A.
The check-out isdone withoutlocking.The check-out isdone withoutlocking.
MCj03871500000[1]
BD18200_
A
Check-outCheck-out
Check-outCheck-out
Andy
Bobby
telerik_logo_new-(white).png
The Copy-Modify-Merge Model (2)
Both of them editthe local copies ofthe file (in thesame time).Both of them editthe local copies ofthe file (in thesame time).
MCj04114760000[1]
RepositoryRepository
BD18200_
A
BD18200_
Andy
MCj03871500000[1]
BD18200_
Bobby
Andy
Bobby
(Local Edit)(Local Edit)
(Local Edit)(Local Edit)
telerik_logo_new-(white).png
MCj04114760000[1]
The Copy-Modify-Merge Model (3)
RepositoryRepository
BD18200_
Bobby
BD18200_
Andy
MCj03871500000[1]
BD18200_
Bobby
Bobby commitsher changes tothe repository.Bobby commitsher changes tothe repository.
CommitCommit
Andy
Bobby
telerik_logo_new-(white).png
The Copy-Modify-Merge Model (4)
Andy tries tocommit hischanges.Andy tries tocommit hischanges.
versionconflictoccurs.versionconflictoccurs.
CommitCommit
RepositoryRepository
BD18200_
Bobby
MCj03871500000[1]
BD18200_
Bobby
MCj04114760000[1]
BD18200_
Andy
Andy
Bobby
(LocalConflict)(LocalConflict)
telerik_logo_new-(white).png
The Copy-Modify-Merge Model (5)
Andy updates hischanges with the onesfrom the repository.Andy updates hischanges with the onesfrom the repository.
The changes merge intohis local copy.The changes merge intohis local copy.
merge conflict canoccur.merge conflict canoccur.
UpdateUpdate
(with merge)(with merge)
RepositoryRepository
BD18200_
Bobby
MCj03871500000[1]
BD18200_
Bobby
MCj04114760000[1]
BD18200_
Andy
&
Bobby
Andy
Bobby
(LocalMerge)(LocalMerge)
telerik_logo_new-(white).png
MCj04114760000[1]
The Copy-Modify-Merge Model (6)
RepositoryRepository
BD18200_
BD18200_
Andy commitsthe changes tothe repository.Andy commitsthe changes tothe repository.
commonversion with thechanges of Andyand Bobby isinserted.commonversion with thechanges of Andyand Bobby isinserted.
CommitCommit
MCj03871500000[1]
BD18200_
Bobby
Andy
&
Bobby
Andy
&
Bobby
Andy
Bobby
telerik_logo_new-(white).png
The Copy-Modify-Merge Model (7)
Bobby updates thechanges from therepository.Bobby updates thechanges from therepository.
She gets thecommon versionwith the changesof Andy andBobby.She gets thecommon versionwith the changesof Andy andBobby.
UpdateUpdate
MCj04114760000[1]
RepositoryRepository
BD18200_
BD18200_
MCj03871500000[1]
BD18200_
Andy
&
Bobby
Andy
&
Bobby
Andy
&
Bobby
Andy
Bobby
telerik_logo_new-(white).png
Tags and Branching
http://fineartamerica.com/images-medium/branching-out-dina-dargo.jpg
telerik_logo_new-(white).png
Tags
Tags enable the naming of group of files indifferent versionsTags enable the naming of group of files indifferent versions
BD18200_
Main.cs
BD18200_
Test.cs
1.11.1
1.31.3
1.41.4
1.21.2
BD18200_
Prog.cs
1.11.1
1.21.2
Tag "Beta 2"Tag "Beta 2"
1.11.1
1.31.3
1.21.2
telerik_logo_new-(white).png
Branching
Branching enables group of changes to beseparated in different development lineBranching enables group of changes to beseparated in different development line
Branching is suitable for:Branching is suitable for:
Development of additions for version of theproduct (for example version 2.0)Development of additions for version of theproduct (for example version 2.0)
The additions are independent from the maindevelopment lineThe additions are independent from the maindevelopment line
Saves the possibility of making changes to theold version (for example version 1.0.1)Saves the possibility of making changes to theold version (for example version 1.0.1)
telerik_logo_new-(white).png
Branching – Example
BD18200_
Main.h
1.11.1
1.21.2
1.31.3
1.41.4
1.2.2.11.2.2.1
1.2.2.21.2.2.2
1.2.4.11.2.4.1
1.2.4.21.2.4.2
1.2.4.31.2.4.3
1.2.2.2.2.11.2.2.2.2.1
1.2.2.2.2.21.2.2.2.2.2
Branch 1.2.2.2.2 ->Branch 1.2.2.2.2 ->
Branch 1.2.2. ->Branch 1.2.2. ->
Branch 1.2.4. ->Branch 1.2.4. ->
Main TrunkMain Trunk
telerik_logo_new-(white).png
Subversion
Using Subversion and TortoiseSVNUsing Subversion and TortoiseSVN
http://svn.haxx.se/dev/archive-2008-07/att-0454/subversion-background.png
telerik_logo_new-(white).png
Subversion
Subversion (SVN)Subversion (SVN)
Open source SCM repositoryOpen source SCM repository
Runs on UNIX, Linux, WindowsRuns on UNIX, Linux, Windows
Console clientConsole client
svnsvn
GUI clientGUI client
TortoiseSVN – http://tortoisesvn.tigris.org/TortoiseSVN – http://tortoisesvn.tigris.org/
Visual Studio plug-in client (AnkhSVN)Visual Studio plug-in client (AnkhSVN)
telerik_logo_new-(white).png
Subversion – Features
Versioning of the directory structureVersioning of the directory structure
Complete change logComplete change log
Deletion of files and directoriesDeletion of files and directories
Renaming of files and directoriesRenaming of files and directories
Saving of files or directoriesSaving of files or directories
Can work on it’s own or integrated with Apacheas moduleCan work on it’s own or integrated with Apacheas module
Works effectively with tags and branchingWorks effectively with tags and branching
telerik_logo_new-(white).png
TortoiseSVN
TortoiseSVNTortoiseSVN
Open source GUIclient forSubversionOpen source GUIclient forSubversion
Integrated inWindows ExplorerIntegrated inWindows Explorer
telerik_logo_new-(white).png
AnkhSVN
Visual Studio plug-in for accessing SVNrepositories – http://ankhsvn.open.collab.netVisual Studio plug-in for accessing SVNrepositories – http://ankhsvn.open.collab.net
AnkhSVN ScreenShot
telerik_logo_new-(white).png
Subversion & TortoiseSVN
Live DemoLive Demo
http://svn.haxx.se/dev/archive-2008-07/att-0454/subversion-background.png
http://tsvn.e-posta.sk/images/tsvn_logo.png
http://webjackalope.com/wp-content/uploads/2009/09/versions.jpg
http://tortoisesvn.tigris.org/tortoisesvn_logo_hor468x64.PNG
telerik_logo_new-(white).png
Software Configuration Management (SCM)
Questions?Questions?
http://www.canberra.edu.au/__data/assets/image/0009/686070/questions.jpg