03.13.13 WANDisco SVN Training: Advanced Branching & Merging
-
Upload
wandisco-plc -
Category
Technology
-
view
2.465 -
download
1
description
Transcript of 03.13.13 WANDisco SVN Training: Advanced Branching & Merging
Advanced Branching and Merging
We will begin in a few moments
Presenter
Michael LesterWandisco
Director of Training
Advanced Branching and Merging
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
This training is done with the latest TortoiseSVN Version
http://www.wandisco.com/subversion/download
5
Concurrent Development
Definition When the same code/project has multiple developers working at the same time.
6
Concurrent Development
Subversion tools that support concurrent development
Branching
Merging
Author identification
Hook scripts
Difference reporting
7
Who changed / created / deleted what
8
Who changed / created / deleted what
Author information is availablethrough svnlook command
And statistics
svnlook author -r 40 /var/svn/repos
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
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
11
Release patches (bug-fix)
Payroll application
Trunk
Rel 1.0
Trunk
Rel 1.0
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
13
When NOT to branch
• Small changes
• From “TAGS” folder
14
Branching from working copy
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
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
17
How do you keep track of “What is the actual release”
18
Identifying Branches in Subversion
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.
20
Merging in actionBug fix / concurrent development
21
Merging in action
Now the branch changes
While the trunk changes
onetwothreefourfivesixSeveneight
onetwotwothreefourfivesixSeven7eight
onetwothreefour5sixSevenEight
22
Merging in action – modification occurs
After both commits
mike-bigfix-01172011
Trunk
23
Merging in action
You always start from a working
folder
mike-bigfix-01172011
24
Merging in action – changes are made
onetwotwothreefour5sixSeven7eight
25
Merging in action – Commit to trunk
26
Merging in action – mergeinfo
The property svn:mergeinfo is added automatically
27
Merging in action
The revision numbers 9 – 11 are the starting and ending changes in the branch
28
Merge information
You can view the branchinformation graphically
29
Merging in action – collision ahead
Now the branch changes
While the trunk changes
onetwothreefourfivesixSeveneight
onetwotwothreefourfivesixSeven7eight
onetwo22twothreefour5sixSevenEight
30
Merging in action
31
Merging in action
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
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
34
Using the hidden menu to merge
Shift/right click
35
Include merged revisions in Log Messages
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
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
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”.
39
Another reason for Log Messages
How does the other branch find out about the useful code?
40
Searching for log messages
41
Merge from log messages
42
1. Practice
2. Practice
3. Add branching and merging to “Policies & Procedures”
4. Train staff
5. Revise your policies & Procedures
Conclusions
43Copyright © 2013 WANdisco.com All rights reserved.
Presenter
Michael LesterWandisco
Director of Training
April 4th
SubversionAdministration
April 18th
Introduction to SmartSVN