Title: Common Revision Control Practices with Subversion
1Common Revision Control Practices with Subversion
- Inland Empire ColdFusion User Group
- Brian LeGros
- http//www.brianlegros.com/blog
2me
- 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
3terminology
4repository
- Administrable container for all Resources needing
revisioning.
5repository - 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.
6resource
- Artifacts stored within the Repository, typically
shown as directories and files.
7resource - 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.
8project
- Grouping of like Resources contained within a
Repository - Usually multiple Projects per Repository
9project - Subversion
- No formal notion of a Project
- Project usually created as a named directory with
the following structure
- project
- branches
- tags
- trunk
10revision
- A version number associated with a chain of
changes to the contents of a single or multiple
Resources in the Repository
11revision - 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
12checkout
- To retrieve a Resource from the Repository to
view and/or edit the Resource.
13checkout - 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.
14check-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
15HEAD
- 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.
16HEAD
- 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
17trunk
- Unique line of development specific to a Project
18branch
- A unique line of development based on a copy of
the Trunk or another Branch.
19tag
- A labeled snapshot of the Trunk, or a Branch, at
a particular Revision.
20branch / 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
21merge
- Process of integrating the change set associated
with a Branch into another Branch or the Trunk.
22merge - 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)
23patch
- Process of creating an artifact representative of
the change set associated with a Branch or the
Trunk.
24patch - Subversion
- 1st step of the merge process placed into a file
external to the Repository. - Can only work on non-binary files.
25take a look at Subversion
26concurrency models
27what?
- Control mechanisms for concurrently editing
Resources in the Repository
28lock / edit / watch
29Basic Flow
30Basic Flow
2. Checkout
1. Checkout
31Basic Flow
2. Checkout
32Basic Flow
2. Checkout 5. Lock
33Basic Flow
2. Checkout 5. Lock 6. Watch
34Basic Flow
2. Checkout 5. Lock 6. Watch
- 1. Checkout
- Lock
- 4. Edit
- 7. Check-in
- 8. Unlock
35Basic Flow
2. Checkout 5. Lock 6. Watch 9. Notify
- 1. Checkout
- Lock
- 4. Edit
- 7. Commit
- 8. Unlock
36Basic Flow
2. Checkout 5. Lock 6. Watch 9. Notify 10.
Lock 11. Rinse/Repeat
- 1. Checkout
- Lock
- 4. Edit
- 7. Commit
- 8. Unlock
37Alternative Flow - Highjack
2. Checkout 5. Lock
38Alternative Flow - Highjack
2. Checkout 5. Lock 6. Hijack
39Alternative Flow - Highjack
2. Checkout 5. Lock 6. Hijack 7. Edit
40Alternative Flow - Highjack
2. Checkout 5. Lock 6. Hijack 7. Edit
- 1. Checkout
- Lock
- 4. Edit
- 8. Check-in
41Alternative Flow - Highjack
2. Checkout 5. Lock 6. Hijack 7. Edit
- 1. Checkout
- Lock
- 4. Edit
- 8. Check-in
- 9. Watch
42lock / edit / watch
- Benefits
- No conflict resolution needed
- Small learning curve
- Challenges
- Sequential development creep
- Managing hijackers
43checkout / update / check-in
44Basic Flow
45Basic Flow
3. Checkout 4. Edit
1. Checkout 2. Edit
46Basic Flow
3. Checkout 4. Edit
1. Checkout 2. Edit 3. Update
47Basic Flow
3. Checkout 4. Edit
1. Checkout 2. Edit 3. Update 4. Check-in
48Basic Flow
3. Checkout 4. Edit 6. Update
1. Checkout 2. Edit 3. Update 5. Check-in
49Basic Flow
3. Checkout 4. Edit 6. Update 7. Resolve
1. Checkout 2. Edit 3. Update 5. Check-in
50Basic Flow
3. Checkout 4. Edit 6. Update 7. Resolve 8.
Check-in
1. Checkout 2. Edit 3. Update 5. Check-in
51Alternate Flow - Overwrite
3. Checkout 4. Edit 6. Update
1. Checkout 2. Edit 3. Update 5. Check-in
52Alternate Flow - Overwrite
3. Checkout 4. Edit 6. Update 7. Ignore
1. Checkout 2. Edit 3. Update 5. Check-in
53Alternate Flow - Overwrite
3. Checkout 4. Edit 6. Update 7. Ignore 8.
Check-in
1. Checkout 2. Edit 3. Update 5. Check-in
54checkout / update / check-in
- Benefits
- Concurrent development
- Project management friendly
- Challenges
- Integrity of potentially complex conflict
resolutions - Potentially difficult learning curve
55branching strategies
56what?
- Patterns that teams of developers can use to
coordinate concurrent development efforts.
57unstable trunk
58unstable trunk
Trunk
Time
59unstable trunk
Feature 1,2, and 3
Trunk
Time
60unstable trunk
Release 1.0
Branch/Tag
Feature 1,2, and 3
Trunk
Time
61unstable trunk
Fix 1
Release 1.0
Merge
Feature 1,2, and 3
Trunk
Time
62unstable trunk
Fix 1
Release 1.0
Feature 1,2, and 3
Feature 4
Trunk
Time
63unstable trunk
Fix 1
Fix 2
Release 1.0
Merge
Feature 1,2, and 3
Feature 4
Trunk
Time
64unstable trunk
Release 1.1
Branch / Tag
Fix 1
Fix 2
Release 1.0
Feature 1,2, and 3
Feature 4
Trunk
Time
65unstable trunk
Release 1.1
Fix 1
Fix 2
Release 1.0
Feature 1,2, and 3
Feature 4
Feature 5
Trunk
Time
66unstable 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
67unstable trunk
- Benefits
- Simple administration
- Small learning curve
- Challenges
- Encourages a sequential release process
- Potential difficulty coordinating large of
developers - Release planning required
68stable trunk
69stable trunk
Trunk
Time
70stable trunk
Branch 1
Branch
Trunk
Time
71stable trunk
Feature 1, 2, and 3
Branch 1
Trunk
Time
72stable trunk
Feature 1, 2, and 3
Branch 1
Trunk
Branch
Branch 2
Time
73stable trunk
Feature 1, 2, and 3
Branch 1
Trunk
Feature 4
Branch 2
Time
74stable trunk
Feature 1, 2, and 3
Branch 1
Merge
Trunk
Feature 4
Branch 2
Time
75stable trunk
Feature 1, 2, and 3
Branch 1
Release 1.0
Tag
Trunk
Feature 4
Branch 2
Time
76stable trunk
Feature 1, 2, and 3
Fix 1
Branch 1
Release 1.0
Trunk
Feature 4
Branch 2
Time
77stable trunk
Feature 1, 2, and 3
Fix 1
Branch 1
Release 1.0
Trunk
Feature 4
Feature 5
Branch 2
Time
78stable trunk
Feature 1, 2, and 3
Fix 1
Fix 2
Branch 1
Release 1.0
Trunk
Feature 4
Feature 5
Branch 2
Time
79stable trunk
Feature 1, 2, and 3
Fix 1
Fix 2
Branch 1
Release 1.0
Merge
Trunk
Feature 4
Feature 5
Branch 2
Time
80stable 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
81stable 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
82stable 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
83stable 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
84stable trunk
- Benefits
- Parallel releases
- Large team friendly
- Challenges
- High administration costs
- Larger learning curve than unstable trunk
- Release planning required
85promotional strategies
86what?
- Using snapshots of a code base to create
artifacts that correlate to a software
development lifecycle.
87common sdlc
88agile promotion
Trunk
Time
89agile promotion
Branch 1
Branch
Trunk
Time
90agile promotion
Feature 1
Branch 1
Trunk
Time
91agile promotion
Feature 1
Branch 1
Branch 2
Branch
Trunk
Time
92agile promotion
Feature 1
Branch 1
Feature 2
Branch 2
Trunk
Time
93agile promotion
Feature 1
Branch 1
Feature 2
Branch 2
Trunk
Branch
Branch 4
Time
94agile promotion
Feature 1
Branch 1
Feature 2
Branch 2
Branch 3
Branch
Trunk
Branch 4
Time
95agile promotion
Feature 1
Branch 1
Feature 2
Branch 2
Feature 3
Branch 3
Trunk
Branch 4
Time
96agile promotion
Feature 1
Branch 1
Feature 2
Branch 2
Merge
Feature 3
Branch 3
Trunk
Branch 4
Time
97agile promotion
Feature 1
Branch 1
Test 1
Feature 2
Branch 2
Feature 3
Branch 3
Tag
Trunk
Branch 4
Time
98agile promotion
Feature 1
Branch 1
Test 1
Feature 2
Branch 2
Test 2
Feature 3
Branch 3
Tag
Trunk
Branch 4
Time
99agile promotion
Feature 1
Branch 1
Test 1
Feature 2
Branch 2
Test 2
Feature 3
Branch 3
Trunk
Merge
Branch 4
Time
100agile 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
101agile 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
102agile 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
103agile 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)
104references
- 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/
105thanks