03.13.13 wandisco svn training: advanced branching & merging
DESCRIPTION
Get more out of branching and merging in this one-hour, free online training course that will get you leveraging the full potential of Subversion's branching and merging functionality. * Definition of concurrent development * What is a branch? * What triggers a branch? * Types of merges * How to do a merge Presented by Mike Lester. Mike, a 33 year veteran of the software industry, has spent the past 26 years delivering consulting and training services for Subversion and other software configuration management systems. He has taught over 700 classes covering various aspects of implementing and using Subversion and other SCMs. Mike is currently WANdisco’s Director of Subversion Training.TRANSCRIPT
![Page 1: 03.13.13 WANDisco SVN Training: Advanced Branching & Merging](https://reader033.vdocument.in/reader033/viewer/2022042700/5561323bd8b42a162a8b4716/html5/thumbnails/1.jpg)
Advanced Branching and Merging
We will begin in a few moments
Presenter
Michael LesterWandisco
Director of Training
![Page 2: 03.13.13 WANDisco SVN Training: Advanced Branching & Merging](https://reader033.vdocument.in/reader033/viewer/2022042700/5561323bd8b42a162a8b4716/html5/thumbnails/2.jpg)
Advanced Branching and Merging
![Page 3: 03.13.13 WANDisco SVN Training: Advanced Branching & Merging](https://reader033.vdocument.in/reader033/viewer/2022042700/5561323bd8b42a162a8b4716/html5/thumbnails/3.jpg)
3
Outline
Definition of concurrent development
What is a branch What triggers a branch Not all branches require a merge
Branching Demonstration Types of Merges How to do a merge Merge info
Merging Demonstration Conclusions
![Page 4: 03.13.13 WANDisco SVN Training: Advanced Branching & Merging](https://reader033.vdocument.in/reader033/viewer/2022042700/5561323bd8b42a162a8b4716/html5/thumbnails/4.jpg)
This training is done with the latest TortoiseSVN Version
http://www.wandisco.com/subversion/download
![Page 5: 03.13.13 WANDisco SVN Training: Advanced Branching & Merging](https://reader033.vdocument.in/reader033/viewer/2022042700/5561323bd8b42a162a8b4716/html5/thumbnails/5.jpg)
5
Concurrent Development
Definition When the same code/project has multiple developers working at the same time.
![Page 6: 03.13.13 WANDisco SVN Training: Advanced Branching & Merging](https://reader033.vdocument.in/reader033/viewer/2022042700/5561323bd8b42a162a8b4716/html5/thumbnails/6.jpg)
6
Concurrent Development
Subversion tools that support concurrent development
Branching
Merging
Author identification
Hook scripts
Difference reporting
![Page 7: 03.13.13 WANDisco SVN Training: Advanced Branching & Merging](https://reader033.vdocument.in/reader033/viewer/2022042700/5561323bd8b42a162a8b4716/html5/thumbnails/7.jpg)
7
Who changed / created / deleted what
![Page 8: 03.13.13 WANDisco SVN Training: Advanced Branching & Merging](https://reader033.vdocument.in/reader033/viewer/2022042700/5561323bd8b42a162a8b4716/html5/thumbnails/8.jpg)
8
Who changed / created / deleted what
Author information is availablethrough svnlook command
And statistics
svnlook author -r 40 /var/svn/repos
![Page 9: 03.13.13 WANDisco SVN Training: Advanced Branching & Merging](https://reader033.vdocument.in/reader033/viewer/2022042700/5561323bd8b42a162a8b4716/html5/thumbnails/9.jpg)
9
What is a Branch
The basic concept of a branch:
A line of development that exists independently of another line
A branch always begins life as a copy of something, and moves on from there, generating its own history.
Original line of development1st branch
2nd branch
3rd branch
![Page 10: 03.13.13 WANDisco SVN Training: Advanced Branching & Merging](https://reader033.vdocument.in/reader033/viewer/2022042700/5561323bd8b42a162a8b4716/html5/thumbnails/10.jpg)
10
Reasons for Branching
• Releasing patches for systems already in production.
• Preparing interim releases for testing and user evaluation.
• Working on more than one major version of the same code-base.
• Major changes require independent development
![Page 11: 03.13.13 WANDisco SVN Training: Advanced Branching & Merging](https://reader033.vdocument.in/reader033/viewer/2022042700/5561323bd8b42a162a8b4716/html5/thumbnails/11.jpg)
11
Release patches (bug-fix)
Payroll application
Trunk
Rel 1.0
Trunk
Rel 1.0
![Page 12: 03.13.13 WANDisco SVN Training: Advanced Branching & Merging](https://reader033.vdocument.in/reader033/viewer/2022042700/5561323bd8b42a162a8b4716/html5/thumbnails/12.jpg)
12
When to branch
• Concurrent development• To isolate development
• To create tag projects• Keep track of released code
• Custom branch• Limited use• To test unapproved changes
![Page 13: 03.13.13 WANDisco SVN Training: Advanced Branching & Merging](https://reader033.vdocument.in/reader033/viewer/2022042700/5561323bd8b42a162a8b4716/html5/thumbnails/13.jpg)
13
When NOT to branch
• Small changes
• From “TAGS” folder
![Page 14: 03.13.13 WANDisco SVN Training: Advanced Branching & Merging](https://reader033.vdocument.in/reader033/viewer/2022042700/5561323bd8b42a162a8b4716/html5/thumbnails/14.jpg)
14
Branching from working copy
![Page 15: 03.13.13 WANDisco SVN Training: Advanced Branching & Merging](https://reader033.vdocument.in/reader033/viewer/2022042700/5561323bd8b42a162a8b4716/html5/thumbnails/15.jpg)
15
Branching from the TAGS folder
Pros and Cons
There is a bug in Rel 1.0What do you do?
1. Create a bug fix branch1. Create a bug fix branch2. Fix the bug1. Create a bug fix branch2. Fix the bug3. Create another “release”
tags folder branchCheck out
Edit
Update
Commit
![Page 16: 03.13.13 WANDisco SVN Training: Advanced Branching & Merging](https://reader033.vdocument.in/reader033/viewer/2022042700/5561323bd8b42a162a8b4716/html5/thumbnails/16.jpg)
16
Extending the TAGS folder
Pros and Cons
There is a bug in Rel 1.0What do you do?
Check out
Edit
Update
Commit
1. Checkout and Commit to the Rel1.0 branch
![Page 17: 03.13.13 WANDisco SVN Training: Advanced Branching & Merging](https://reader033.vdocument.in/reader033/viewer/2022042700/5561323bd8b42a162a8b4716/html5/thumbnails/17.jpg)
17
How do you keep track of “What is the actual release”
![Page 18: 03.13.13 WANDisco SVN Training: Advanced Branching & Merging](https://reader033.vdocument.in/reader033/viewer/2022042700/5561323bd8b42a162a8b4716/html5/thumbnails/18.jpg)
18
Identifying Branches in Subversion
![Page 19: 03.13.13 WANDisco SVN Training: Advanced Branching & Merging](https://reader033.vdocument.in/reader033/viewer/2022042700/5561323bd8b42a162a8b4716/html5/thumbnails/19.jpg)
19
Deleting Branches
Remember:The directory (project) can always be recovered, but willnot display in the list command unless a specific revision (53) is specified.
![Page 20: 03.13.13 WANDisco SVN Training: Advanced Branching & Merging](https://reader033.vdocument.in/reader033/viewer/2022042700/5561323bd8b42a162a8b4716/html5/thumbnails/20.jpg)
20
Merging in actionBug fix / concurrent development
![Page 21: 03.13.13 WANDisco SVN Training: Advanced Branching & Merging](https://reader033.vdocument.in/reader033/viewer/2022042700/5561323bd8b42a162a8b4716/html5/thumbnails/21.jpg)
21
Merging in action
Now the branch changes
While the trunk changes
onetwothreefourfivesixSeveneight
onetwotwothreefourfivesixSeven7eight
onetwothreefour5sixSevenEight
![Page 22: 03.13.13 WANDisco SVN Training: Advanced Branching & Merging](https://reader033.vdocument.in/reader033/viewer/2022042700/5561323bd8b42a162a8b4716/html5/thumbnails/22.jpg)
22
Merging in action – modification occurs
After both commits
mike-bigfix-01172011
Trunk
![Page 23: 03.13.13 WANDisco SVN Training: Advanced Branching & Merging](https://reader033.vdocument.in/reader033/viewer/2022042700/5561323bd8b42a162a8b4716/html5/thumbnails/23.jpg)
23
Merging in action
You always start from a working
folder
mike-bigfix-01172011
![Page 24: 03.13.13 WANDisco SVN Training: Advanced Branching & Merging](https://reader033.vdocument.in/reader033/viewer/2022042700/5561323bd8b42a162a8b4716/html5/thumbnails/24.jpg)
24
Merging in action – changes are made
onetwotwothreefour5sixSeven7eight
![Page 25: 03.13.13 WANDisco SVN Training: Advanced Branching & Merging](https://reader033.vdocument.in/reader033/viewer/2022042700/5561323bd8b42a162a8b4716/html5/thumbnails/25.jpg)
25
Merging in action – Commit to trunk
![Page 26: 03.13.13 WANDisco SVN Training: Advanced Branching & Merging](https://reader033.vdocument.in/reader033/viewer/2022042700/5561323bd8b42a162a8b4716/html5/thumbnails/26.jpg)
26
Merging in action – mergeinfo
The property svn:mergeinfo is added automatically
![Page 27: 03.13.13 WANDisco SVN Training: Advanced Branching & Merging](https://reader033.vdocument.in/reader033/viewer/2022042700/5561323bd8b42a162a8b4716/html5/thumbnails/27.jpg)
27
Merging in action
The revision numbers 9 – 11 are the starting and ending changes in the branch
![Page 28: 03.13.13 WANDisco SVN Training: Advanced Branching & Merging](https://reader033.vdocument.in/reader033/viewer/2022042700/5561323bd8b42a162a8b4716/html5/thumbnails/28.jpg)
28
Merge information
You can view the branchinformation graphically
![Page 29: 03.13.13 WANDisco SVN Training: Advanced Branching & Merging](https://reader033.vdocument.in/reader033/viewer/2022042700/5561323bd8b42a162a8b4716/html5/thumbnails/29.jpg)
29
Merging in action – collision ahead
Now the branch changes
While the trunk changes
onetwothreefourfivesixSeveneight
onetwotwothreefourfivesixSeven7eight
onetwo22twothreefour5sixSevenEight
![Page 30: 03.13.13 WANDisco SVN Training: Advanced Branching & Merging](https://reader033.vdocument.in/reader033/viewer/2022042700/5561323bd8b42a162a8b4716/html5/thumbnails/30.jpg)
30
Merging in action
![Page 31: 03.13.13 WANDisco SVN Training: Advanced Branching & Merging](https://reader033.vdocument.in/reader033/viewer/2022042700/5561323bd8b42a162a8b4716/html5/thumbnails/31.jpg)
31
Merging in action
![Page 32: 03.13.13 WANDisco SVN Training: Advanced Branching & Merging](https://reader033.vdocument.in/reader033/viewer/2022042700/5561323bd8b42a162a8b4716/html5/thumbnails/32.jpg)
32
Merging in action – Resolve the conflict
Before you can do a commit you must tell Subversion that the conflicts have been resolved
Remember – you still have to do a commit to update the repository
![Page 33: 03.13.13 WANDisco SVN Training: Advanced Branching & Merging](https://reader033.vdocument.in/reader033/viewer/2022042700/5561323bd8b42a162a8b4716/html5/thumbnails/33.jpg)
33
Special merging situations – no change in trunk
After branch changes
bigfix-20311
Trunk
7 8
1211
9
13 14
Do I have to merge ?Check out the trunk HEAD version
Merge like normalsvn:mergeinfo /payroll/bugfix-20311:11-14
![Page 34: 03.13.13 WANDisco SVN Training: Advanced Branching & Merging](https://reader033.vdocument.in/reader033/viewer/2022042700/5561323bd8b42a162a8b4716/html5/thumbnails/34.jpg)
34
Using the hidden menu to merge
Shift/right click
![Page 35: 03.13.13 WANDisco SVN Training: Advanced Branching & Merging](https://reader033.vdocument.in/reader033/viewer/2022042700/5561323bd8b42a162a8b4716/html5/thumbnails/35.jpg)
35
Include merged revisions in Log Messages
![Page 36: 03.13.13 WANDisco SVN Training: Advanced Branching & Merging](https://reader033.vdocument.in/reader033/viewer/2022042700/5561323bd8b42a162a8b4716/html5/thumbnails/36.jpg)
36
Command line mergeinfo command
C:\source\newFeature>svn mergeinfo c:\source\payroll --show-revs mergedr15r18
C:\source\newFeature>svn mergeinfo c:\source\payroll --show-revs eligibler21
This can be used to show what has been merged and what could be merged
![Page 37: 03.13.13 WANDisco SVN Training: Advanced Branching & Merging](https://reader033.vdocument.in/reader033/viewer/2022042700/5561323bd8b42a162a8b4716/html5/thumbnails/37.jpg)
37
Cherrypicking
This refers to choosing one specific changeset from a branch and replicating it to another.
TRUNK
Custom Branch
This fixed a bug
reproducable in the trunk This added a
new feature for a unique
customer
![Page 38: 03.13.13 WANDisco SVN Training: Advanced Branching & Merging](https://reader033.vdocument.in/reader033/viewer/2022042700/5561323bd8b42a162a8b4716/html5/thumbnails/38.jpg)
38
Cherrypicking
How does the other branch find out about the useful code?
I fixed a bug in my custom project that probably
exists in the trunk.
It was logged as bug fix 1655.
Something about “customer sort”.
![Page 39: 03.13.13 WANDisco SVN Training: Advanced Branching & Merging](https://reader033.vdocument.in/reader033/viewer/2022042700/5561323bd8b42a162a8b4716/html5/thumbnails/39.jpg)
39
Another reason for Log Messages
How does the other branch find out about the useful code?
![Page 40: 03.13.13 WANDisco SVN Training: Advanced Branching & Merging](https://reader033.vdocument.in/reader033/viewer/2022042700/5561323bd8b42a162a8b4716/html5/thumbnails/40.jpg)
40
Searching for log messages
![Page 41: 03.13.13 WANDisco SVN Training: Advanced Branching & Merging](https://reader033.vdocument.in/reader033/viewer/2022042700/5561323bd8b42a162a8b4716/html5/thumbnails/41.jpg)
41
Merge from log messages
![Page 42: 03.13.13 WANDisco SVN Training: Advanced Branching & Merging](https://reader033.vdocument.in/reader033/viewer/2022042700/5561323bd8b42a162a8b4716/html5/thumbnails/42.jpg)
42
1. Practice
2. Practice
3. Add branching and merging to “Policies & Procedures”
4. Train staff
5. Revise your policies & Procedures
Conclusions
![Page 43: 03.13.13 WANDisco SVN Training: Advanced Branching & Merging](https://reader033.vdocument.in/reader033/viewer/2022042700/5561323bd8b42a162a8b4716/html5/thumbnails/43.jpg)
43Copyright © 2013 WANdisco.com All rights reserved.
Presenter
Michael LesterWandisco
Director of Training
April 4th
SubversionAdministration
April 18th
Introduction to SmartSVN