02.19.13 wandisco svn training: branching options for development

42
We will begin in a few moments Branching Options for Development Presenter Michael Lester Wandisco Director of Training

Upload: wandisco-plc

Post on 24-May-2015

1.949 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: 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

Page 2: 02.19.13 WANDisco SVN Training: Branching Options for Development

Branching Options for Development

Page 3: 02.19.13 WANDisco SVN 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

Page 4: 02.19.13 WANDisco SVN Training: Branching Options for Development

This training is done with the latest TortoiseSVN Version

http://www.wandisco.com/subversion/download

Page 5: 02.19.13 WANDisco SVN Training: Branching Options for Development

5

Non-Concurrent Development

33 34 43 51

Definition The easiest type of development.

One person projects.

Page 6: 02.19.13 WANDisco SVN Training: Branching Options for Development

6

Concurrent Development

Definition When the same code/project has multiple developers working at the same time.

edit

Branching

SimultaneousDevelopment

Page 7: 02.19.13 WANDisco SVN Training: Branching Options for Development

7

Concurrent Development

Subversion tools that support concurrent development

Branching

Merging

Author identification

Hook scripts

Difference reporting

Properties

Page 8: 02.19.13 WANDisco SVN Training: Branching Options for Development

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

Page 9: 02.19.13 WANDisco SVN Training: Branching Options for Development

9

Branching from working copy

Page 10: 02.19.13 WANDisco SVN Training: Branching Options for Development

10

Branching from the repository

Page 11: 02.19.13 WANDisco SVN Training: Branching Options for Development

11

Different Development Models

Branch nothing

Branch everything

Branch big things

Page 12: 02.19.13 WANDisco SVN Training: Branching Options for Development

12

“Branch nothing” development model

12 13 14

Payroll application

Trunk

Sometimes a checkout/commit cycle does notinvolve concurrent development

edit

15

Page 13: 02.19.13 WANDisco SVN Training: Branching Options for Development

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

Page 14: 02.19.13 WANDisco SVN Training: Branching Options for Development

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

Page 15: 02.19.13 WANDisco SVN Training: Branching Options for Development

15

Update issues

2nd edit

15

update

updateedit

Extra step may introduce• New bugs• Unclear code• Non-compilable• Non-testable• Update hesitation

Page 16: 02.19.13 WANDisco SVN Training: Branching Options for Development

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

Page 17: 02.19.13 WANDisco SVN Training: Branching Options for Development

17

Update issues

What may happen

1. Users stop doing updates2. Users start doing updates badly

Page 18: 02.19.13 WANDisco SVN Training: Branching Options for Development

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

Page 19: 02.19.13 WANDisco SVN Training: Branching Options for Development

19

The end of a bugfix

Payroll application

Rel 1.0

Rel 1.0 Bug Fix

No Changes

Rel 1.0 1 No Changes

Page 20: 02.19.13 WANDisco SVN Training: Branching Options for Development

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/

Page 21: 02.19.13 WANDisco SVN Training: Branching Options for Development

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”

Page 22: 02.19.13 WANDisco SVN Training: Branching Options for Development

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”

Page 23: 02.19.13 WANDisco SVN Training: Branching Options for Development

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

Page 24: 02.19.13 WANDisco SVN Training: Branching Options for Development

24

Bug fix merging notification – no automation

Trunk

Rel 1.0 Bug Fix

Project management meetings Email Face-to-face

Page 25: 02.19.13 WANDisco SVN Training: Branching Options for Development

25

Merging notification – using SVN properties

1. Set property2. Hook script emails correct developer3. Hook script updates project management system4. Changes property to “emailSent”

Page 26: 02.19.13 WANDisco SVN Training: Branching Options for Development

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

Page 27: 02.19.13 WANDisco SVN Training: Branching Options for Development

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

Page 28: 02.19.13 WANDisco SVN Training: Branching Options for Development

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

Page 29: 02.19.13 WANDisco SVN Training: Branching Options for Development

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

Page 30: 02.19.13 WANDisco SVN Training: Branching Options for Development

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

Page 31: 02.19.13 WANDisco SVN Training: Branching Options for Development

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

Page 32: 02.19.13 WANDisco SVN Training: Branching Options for Development

32

When NOT to branch

• Small changes

• From “TAGS” folder

Page 33: 02.19.13 WANDisco SVN Training: Branching Options for Development

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

Page 34: 02.19.13 WANDisco SVN Training: Branching Options for Development

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

Page 35: 02.19.13 WANDisco SVN Training: Branching Options for Development

35

How do you keep track of “What is the actual release”

Page 36: 02.19.13 WANDisco SVN Training: Branching Options for Development

36

Identifying Branches in Subversion

Page 37: 02.19.13 WANDisco SVN Training: Branching Options for Development

37

Identifying Branches in Subversion

Remember, you can always see the svn:mergeinfo property

Page 38: 02.19.13 WANDisco SVN Training: Branching Options for Development

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.

Page 39: 02.19.13 WANDisco SVN Training: Branching Options for Development

39

Finding Deleted Branches

Make it easy to find deleted branches.

Use LOG messages

Move deleted branches to a “Deleted” folder.

OR

Page 40: 02.19.13 WANDisco SVN Training: Branching Options for Development

40

1. Practice

2. Practice

3. Add branching and merging to “Policies & Procedures”

4. Train staff

5. Revise your policies & Procedures

Conclusions

Page 41: 02.19.13 WANDisco SVN Training: Branching Options for Development

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:

[email protected]

925.380.1728

Other questions?

[email protected]

925.380.1728

Stay connected: @WANdisco

linkedin.com/company/wandisco

Page 42: 02.19.13 WANDisco SVN Training: Branching Options for Development

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