WANdisco Non-Stop Hadoop: PHXDataConference Presentation Oct 2014
02.19.13 WANDisco SVN Training: Branching Options for Development
-
Upload
wandisco-plc -
Category
Documents
-
view
1.949 -
download
1
Transcript of 02.19.13 WANDisco SVN Training: Branching Options for Development
We will begin in a few moments
Branching Options for Development
Presenter
Michael LesterWandisco
Director of Training
Branching Options for Development
3
Outline
Definition of concurrent development What is a branch Different development models What triggers a branch
Branching Demonstration Communication for branching and
merging Conclusions
This training is done with the latest TortoiseSVN Version
http://www.wandisco.com/subversion/download
5
Non-Concurrent Development
33 34 43 51
Definition The easiest type of development.
One person projects.
6
Concurrent Development
Definition When the same code/project has multiple developers working at the same time.
edit
Branching
SimultaneousDevelopment
7
Concurrent Development
Subversion tools that support concurrent development
Branching
Merging
Author identification
Hook scripts
Difference reporting
Properties
8
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
9
Branching from working copy
10
Branching from the repository
11
Different Development Models
Branch nothing
Branch everything
Branch big things
12
“Branch nothing” development model
12 13 14
Payroll application
Trunk
Sometimes a checkout/commit cycle does notinvolve concurrent development
edit
15
13
“Branch nothing” development model
12 13 14
Payroll application
Trunk
Sometimes a checkout/commit cycle does involve concurrent development
edit
15
edit
16
Monday
Tuesday
Wednesday
14
“Branch nothing” development model
14
Payroll application
Trunk
Before the second developer can commit, an update needs to happen
2nd edit
15
1st edit
16
update
updateedit
15
Update issues
2nd edit
15
update
updateedit
Extra step may introduce• New bugs• Unclear code• Non-compilable• Non-testable• Update hesitation
16
Update issues
2nd edit
15
update
updateedit
This can be a real issue if lots of people are working on the same files 4th edit
updateedit
3rd edit
updateedit
update update
Design issues may make this a problem.
2318
17
Update issues
What may happen
1. Users stop doing updates2. Users start doing updates badly
18
Bug fix branch – merge or not decision
Payroll application
Trunk
Rel 1.0
Rel 1.0 Bug Fix
No Changes
Merge bugfix back to trunk
19
The end of a bugfix
Payroll application
Rel 1.0
Rel 1.0 Bug Fix
No Changes
Rel 1.0 1 No Changes
20
More bugfixes
Payroll application
Rel 1.0
Rel 1.0 Bug Fix
No Changes
Rel 1.0 1 No Changes
Rel 1.0 2 No Changestags/
tags/
tags/
branches/
21
Release patches (bug-fix) – When to merge
Payroll application
Trunk
Rel 1.0 Bug Fix
This could involve all changes to “Rel 1.0 Bug Fix”
22
Release patches (bug-fix) – When to merge
BankDocSystem
Trunk
Rel 1.0 Bug Fix
Or “cherry pick” specific changes in “Rel 1.0 Bug Fix”
23
Release patches (bug-fix) – When to merge
BankDocSystem
30
Trunk
Rel 1.0 Bug Fix31
Or “cherry pick” specific changes in “Rel 1.0 Bug Fix”
Rev 31Not needed in trunk
24
Bug fix merging notification – no automation
Trunk
Rel 1.0 Bug Fix
Project management meetings Email Face-to-face
25
Merging notification – using SVN properties
1. Set property2. Hook script emails correct developer3. Hook script updates project management system4. Changes property to “emailSent”
26
“Branch everything” development model
All developers work on a branch related to a task
A bug An enhancement
When bugs / enhancements are finished, they are merged into the trunk
27
“Branch everything” development model
Advantages• All work isolated• All work scheduled• All work branched from stable trunk revision• Small independent merges
Disadvantages• Lots of branches• Lots of merges• Large overhead for some 1 character fixes
28
“Branch big things” development model
All tasks categorized
A branch contains a group of related tasks
or enhancements
Trunk development for
small things
Classification is done by project leaders or in team meetings.
Criteria• Scope• Interactions of
bugs/enhancements• Need for testing• Time considerations
29
“Branch big things” development model
All tasks categorized
A branch contains a group of related tasks
or enhancements
When development branches are finished, they are merged into the trunk
30
“Branch big things” development model
All tasks categorized
Trunk
development for small things
Small development needs should be quick, relatively non-tested, and usually done by one person.
12 13 14
Trunkedit
15
31
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
32
When NOT to branch
• Small changes
• From “TAGS” folder
33
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
34
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
35
How do you keep track of “What is the actual release”
36
Identifying Branches in Subversion
37
Identifying Branches in Subversion
Remember, you can always see the svn:mergeinfo property
38
Deleting Branches
Remember:The directory (project) can always be recovered, but willnot display in the list command unless a specific revision (53) is specified.
39
Finding Deleted Branches
Make it easy to find deleted branches.
Use LOG messages
Move deleted branches to a “Deleted” folder.
OR
40
1. Practice
2. Practice
3. Add branching and merging to “Policies & Procedures”
4. Train staff
5. Revise your policies & Procedures
Conclusions
Copyright © 2010 WANdisco, Inc. All rights reserved.
Promotions and resources
Free MultiSite Evaluation for Enterprises
o Free for 7 dayso No Risko $12K value
10% Off SmartSVN
Professional w/Discount Code
“SmartUpgrade10” To speak to a global software development specialist:
925.380.1728
Other questions?
925.380.1728
Stay connected: @WANdisco
linkedin.com/company/wandisco
42Copyright © 2012 WANdisco All rights reserved.
Presenter
Michael LesterWandisco
Director of Training
Feb 28th
Getting Info Out of Subversion
March 14th
Advanced Branching and
Merging