Common Revision Control Practices with Subversion - PowerPoint PPT Presentation

1 / 105
About This Presentation
Title:

Common Revision Control Practices with Subversion

Description:

Stored in a Berkley DB or the file system ... Managing hijackers. checkout / update / check-in. Basic Flow. Main.mxml. Basic Flow. 3. Checkout ... – PowerPoint PPT presentation

Number of Views:90
Avg rating:3.0/5.0
Slides: 106
Provided by: non8176
Category:

less

Transcript and Presenter's Notes

Title: Common Revision Control Practices with Subversion


1
Common Revision Control Practices with Subversion
  • Inland Empire ColdFusion User Group
  • Brian LeGros
  • http//www.brianlegros.com/blog

2
me
  • Co-founder of the Adobe Developers of Greater
    Orlando (http//adogo.us)
  • ColdFusion 7 years
  • Flex/Actionscript 1 year
  • Technical Lead for the Web Team at CFI

3
terminology
4
repository
  • Administrable container for all Resources needing
    revisioning.

5
repository - Subversion
  • Stored in a Berkley DB or the file system
  • Has hooks to execute scripts when an action
    occurs in the Repository (i.e. post-commit).
  • File backups occur on the Repository level.
  • Can be exposed via HTTP or SVN protocol.
  • User authentication at Repository level.
  • User authorization granular to the directory.

6
resource
  • Artifacts stored within the Repository, typically
    shown as directories and files.

7
resource - Subversion
  • Directories and files are used as Resources in a
    simple file system.
  • Directories are separate resources from files
    even though they are containers for files.
  • Files are identified as binary and non-binary
    which will determine how they are stored.

8
project
  • Grouping of like Resources contained within a
    Repository
  • Usually multiple Projects per Repository

9
project - Subversion
  • No formal notion of a Project
  • Project usually created as a named directory with
    the following structure
  • project
  • branches
  • tags
  • trunk

10
revision
  • A version number associated with a chain of
    changes to the contents of a single or multiple
    Resources in the Repository

11
revision - Subversion
  • project
  • branches
  • tags
  • trunk
  • src
  • index.cfm
  • Revision Snapshot of Repository

Revision 13
  • project
  • branches
  • tags
  • trunk
  • src
  • layout
  • project
  • branches
  • tags
  • trunk
  • src
  • layout
  • index.cfm

Revision 15
Revision 14
12
checkout
  • To retrieve a Resource from the Repository to
    view and/or edit the Resource.

13
checkout - Subversion
  • Working copy
  • Created when you checkout a directory and/or its
    contents from a Repository.
  • Cannot checkout individual files.
  • Contains hidden files on your file system which
    keep track of the changes you make on your local
    machine and how they differ from the latest
    Revision for a Resource in the Repository.

14
check-in
  • Saving the latest set of changes as a Revision
    for a single or group of Resources.
  • Subversion Commit
  • File/directory changes must be contained in a
    working copy to be detected

15
HEAD
  • Most recent Revision that a a group of Resources
    or an individual Resource was changed, added, or
    removed.
  • Subversion
  • HEAD is the last Revision of the Repository in
    which the file or directory was touched.

16
HEAD
  • project 105
  • branches 100
  • tags 100
  • trunk 105
  • src 105
  • layout 101
  • index.cfm 105

project HEAD 105, index.cfm HEAD 105,
branches HEAD 100
17
trunk
  • Unique line of development specific to a Project

18
branch
  • A unique line of development based on a copy of
    the Trunk or another Branch.

19
tag
  • A labeled snapshot of the Trunk, or a Branch, at
    a particular Revision.

20
branch / tag - Subversion
  • Copy Makes a copy of one directory into a newly
    named directory.
  • Branches, Tags, Trunk are all directories with
    semantic meaning
  • Copy command in some clients will add metadata
    showing the intent of the copy

21
merge
  • Process of integrating the change set associated
    with a Branch into another Branch or the Trunk.

22
merge - Subversion
  • 2 step process
  • Build change set from Branch needing integration
    (svn diff)
  • Integrate change set into Branch or Trunk (apply
    svn diff to working copy)

23
patch
  • Process of creating an artifact representative of
    the change set associated with a Branch or the
    Trunk.

24
patch - Subversion
  • 1st step of the merge process placed into a file
    external to the Repository.
  • Can only work on non-binary files.

25
take a look at Subversion
26
concurrency models
27
what?
  • Control mechanisms for concurrently editing
    Resources in the Repository

28
lock / edit / watch
29
Basic Flow
30
Basic Flow
2. Checkout
1. Checkout
31
Basic Flow
2. Checkout
  • 1. Checkout
  • Lock
  • 4. Edit

32
Basic Flow
2. Checkout 5. Lock
  • 1. Checkout
  • Lock
  • 4. Edit

33
Basic Flow
2. Checkout 5. Lock 6. Watch
  • 1. Checkout
  • Lock
  • 4. Edit

34
Basic Flow
2. Checkout 5. Lock 6. Watch
  • 1. Checkout
  • Lock
  • 4. Edit
  • 7. Check-in
  • 8. Unlock

35
Basic Flow
2. Checkout 5. Lock 6. Watch 9. Notify
  • 1. Checkout
  • Lock
  • 4. Edit
  • 7. Commit
  • 8. Unlock

36
Basic Flow
2. Checkout 5. Lock 6. Watch 9. Notify 10.
Lock 11. Rinse/Repeat
  • 1. Checkout
  • Lock
  • 4. Edit
  • 7. Commit
  • 8. Unlock

37
Alternative Flow - Highjack
2. Checkout 5. Lock
  • 1. Checkout
  • Lock
  • 4. Edit

38
Alternative Flow - Highjack
2. Checkout 5. Lock 6. Hijack
  • 1. Checkout
  • Lock
  • 4. Edit

39
Alternative Flow - Highjack
2. Checkout 5. Lock 6. Hijack 7. Edit
  • 1. Checkout
  • Lock
  • 4. Edit

40
Alternative Flow - Highjack
2. Checkout 5. Lock 6. Hijack 7. Edit
  • 1. Checkout
  • Lock
  • 4. Edit
  • 8. Check-in

41
Alternative Flow - Highjack
2. Checkout 5. Lock 6. Hijack 7. Edit
  • 1. Checkout
  • Lock
  • 4. Edit
  • 8. Check-in
  • 9. Watch

42
lock / edit / watch
  • Benefits
  • No conflict resolution needed
  • Small learning curve
  • Challenges
  • Sequential development creep
  • Managing hijackers

43
checkout / update / check-in
44
Basic Flow
45
Basic Flow
3. Checkout 4. Edit
1. Checkout 2. Edit
46
Basic Flow
3. Checkout 4. Edit
1. Checkout 2. Edit 3. Update
47
Basic Flow
3. Checkout 4. Edit
1. Checkout 2. Edit 3. Update 4. Check-in
48
Basic Flow
3. Checkout 4. Edit 6. Update
1. Checkout 2. Edit 3. Update 5. Check-in
49
Basic Flow
3. Checkout 4. Edit 6. Update 7. Resolve
1. Checkout 2. Edit 3. Update 5. Check-in
50
Basic Flow
3. Checkout 4. Edit 6. Update 7. Resolve 8.
Check-in
1. Checkout 2. Edit 3. Update 5. Check-in
51
Alternate Flow - Overwrite
3. Checkout 4. Edit 6. Update
1. Checkout 2. Edit 3. Update 5. Check-in
52
Alternate Flow - Overwrite
3. Checkout 4. Edit 6. Update 7. Ignore
1. Checkout 2. Edit 3. Update 5. Check-in
53
Alternate Flow - Overwrite
3. Checkout 4. Edit 6. Update 7. Ignore 8.
Check-in
1. Checkout 2. Edit 3. Update 5. Check-in
54
checkout / update / check-in
  • Benefits
  • Concurrent development
  • Project management friendly
  • Challenges
  • Integrity of potentially complex conflict
    resolutions
  • Potentially difficult learning curve

55
branching strategies
56
what?
  • Patterns that teams of developers can use to
    coordinate concurrent development efforts.

57
unstable trunk
58
unstable trunk
Trunk
Time
59
unstable trunk
Feature 1,2, and 3
Trunk
Time
60
unstable trunk
Release 1.0
Branch/Tag
Feature 1,2, and 3
Trunk
Time
61
unstable trunk
Fix 1
Release 1.0
Merge
Feature 1,2, and 3
Trunk
Time
62
unstable trunk
Fix 1
Release 1.0
Feature 1,2, and 3
Feature 4
Trunk
Time
63
unstable trunk
Fix 1
Fix 2
Release 1.0
Merge
Feature 1,2, and 3
Feature 4
Trunk
Time
64
unstable trunk
Release 1.1
Branch / Tag
Fix 1
Fix 2
Release 1.0
Feature 1,2, and 3
Feature 4
Trunk
Time
65
unstable trunk
Release 1.1
Fix 1
Fix 2
Release 1.0
Feature 1,2, and 3
Feature 4
Feature 5
Trunk
Time
66
unstable trunk
Release 1.1
Fix 1
Fix 2
Release 1.0
Release 2.0
Branch / Tag
Feature 1,2, and 3
Feature 4
Feature 5
Trunk
Time
67
unstable trunk
  • Benefits
  • Simple administration
  • Small learning curve
  • Challenges
  • Encourages a sequential release process
  • Potential difficulty coordinating large of
    developers
  • Release planning required

68
stable trunk
69
stable trunk
Trunk
Time
70
stable trunk
Branch 1
Branch
Trunk
Time
71
stable trunk
Feature 1, 2, and 3
Branch 1
Trunk
Time
72
stable trunk
Feature 1, 2, and 3
Branch 1
Trunk
Branch
Branch 2
Time
73
stable trunk
Feature 1, 2, and 3
Branch 1
Trunk
Feature 4
Branch 2
Time
74
stable trunk
Feature 1, 2, and 3
Branch 1
Merge
Trunk
Feature 4
Branch 2
Time
75
stable trunk
Feature 1, 2, and 3
Branch 1
Release 1.0
Tag
Trunk
Feature 4
Branch 2
Time
76
stable trunk
Feature 1, 2, and 3
Fix 1
Branch 1
Release 1.0
Trunk
Feature 4
Branch 2
Time
77
stable trunk
Feature 1, 2, and 3
Fix 1
Branch 1
Release 1.0
Trunk
Feature 4
Feature 5
Branch 2
Time
78
stable trunk
Feature 1, 2, and 3
Fix 1
Fix 2
Branch 1
Release 1.0
Trunk
Feature 4
Feature 5
Branch 2
Time
79
stable trunk
Feature 1, 2, and 3
Fix 1
Fix 2
Branch 1
Release 1.0
Merge
Trunk
Feature 4
Feature 5
Branch 2
Time
80
stable trunk
Feature 1, 2, and 3
Fix 1
Fix 2
Branch 1
Release 1.0
Release 1.1
Tag
Trunk
Feature 4
Feature 5
Branch 2
Time
81
stable trunk
Feature 1, 2, and 3
Fix 1
Fix 2
Branch 1
Release 1.0
Release 1.1
Trunk
Merge
Feature 4
Feature 5
Branch 2
Time
82
stable trunk
Feature 1, 2, and 3
Fix 1
Fix 2
Branch 1
Release 1.0
Release 1.1
Trunk
Merge
Feature 4
Feature 5
Branch 2
Time
83
stable trunk
Feature 1, 2, and 3
Fix 1
Fix 2
Branch 1
Release 1.0
Release 1.1
Release 2.0
Tag
Trunk
Feature 4
Feature 5
Branch 2
Time
84
stable trunk
  • Benefits
  • Parallel releases
  • Large team friendly
  • Challenges
  • High administration costs
  • Larger learning curve than unstable trunk
  • Release planning required

85
promotional strategies
86
what?
  • Using snapshots of a code base to create
    artifacts that correlate to a software
    development lifecycle.

87
common sdlc
88
agile promotion
Trunk
Time
89
agile promotion
Branch 1
Branch
Trunk
Time
90
agile promotion
Feature 1
Branch 1
Trunk
Time
91
agile promotion
Feature 1
Branch 1
Branch 2
Branch
Trunk
Time
92
agile promotion
Feature 1
Branch 1
Feature 2
Branch 2
Trunk
Time
93
agile promotion
Feature 1
Branch 1
Feature 2
Branch 2
Trunk
Branch
Branch 4
Time
94
agile promotion
Feature 1
Branch 1
Feature 2
Branch 2
Branch 3
Branch
Trunk
Branch 4
Time
95
agile promotion
Feature 1
Branch 1
Feature 2
Branch 2
Feature 3
Branch 3
Trunk
Branch 4
Time
96
agile promotion
Feature 1
Branch 1
Feature 2
Branch 2
Merge
Feature 3
Branch 3
Trunk
Branch 4
Time
97
agile promotion
Feature 1
Branch 1
Test 1
Feature 2
Branch 2
Feature 3
Branch 3
Tag
Trunk
Branch 4
Time
98
agile promotion
Feature 1
Branch 1
Test 1
Feature 2
Branch 2
Test 2
Feature 3
Branch 3
Tag
Trunk
Branch 4
Time
99
agile promotion
Feature 1
Branch 1
Test 1
Feature 2
Branch 2
Test 2
Feature 3
Branch 3
Trunk
Merge
Branch 4
Time
100
agile promotion
Feature 1
Branch 1
Test 1
Feature 2
Branch 2
Test 2
Release 1.0
Feature 3
Branch 3
Tag
Trunk
Branch 4
Time
101
agile promotion
Feature 1
Branch 1
Test 1
Feature 2
Branch 2
Test 2
Release 1.0
Feature 3
Branch 3
Trunk
Fix 1
Branch 4
Time
102
agile promotion
Feature 1
Branch 1
Test 1
Feature 2
Branch 2
Test 2
Release 1.0
Feature 3
Branch 3
Trunk
Fix 1
Fix 2
Branch 4
Time
103
agile promtion
  • Benefits
  • Artifacts to pair with SDLC stages for auditing
  • Easier for non-developers to work with snapshots
    (i.e. deployers, reviewers, etc.)
  • No release planning necessary
  • Challenges
  • Requires adherence to an SDLC
  • Potentially large administration costs (e.g. -
    tag clean up)

104
references
  • SVN Online Book - http//svnbook.red-bean.com/
  • Wikipedia Revision control - http//en.wikipedia
    .org/wiki/Scm
  • CollabNet SVN 1.5 Branching Preso -
    http//www.collab.net/webinar21/

105
thanks
Write a Comment
User Comments (0)
About PowerShow.com