Documente Academic
Documente Profesional
Documente Cultură
Release Management/SCM
with TFS
Scott Colestock
Agenda
Branching & Merging
Mechanics within TFS
Strategies
Branching Mechanics
When creating a project, plan for
future branches by placing initial
check-in under a Dev or
Main folder not at your Team
Projects source root
Branch operation asks you to
specify a branch target a
location in the source control
hierarchy where the branch
should live
Branching Mechanics
Most of the time, this will be a
peer e.g. $/OrderSystem/QA
(or whatever the purpose of the
branch is)
Keep clear on the differences
between branch parent/child
relationships and the physical
structure you observe on disk
and in source control
repository
Branching Mechanics
Branch operations result in a set
of pending changes (of type
branch) which must be
checked in before branch is
made real
Branching can cross TFS
projects as well
Useful for sharing code across projects
when you still desire to build/unit-test
independently
Branching Thoughts
Mental model: Just like workspaces provide
isolation for a given developer, branches
provide isolation for a group of developers
Only branch if you have to, and at the
point in time required
Branches can happen after the fact via branchfrom-label, branch-from-changeset, etc.
(Like at the point in time you need to create a
hotfix)
Branching Thoughts
Always ask: Will the cost of merging conflicts in
real time be higher or lower than the cost of
merging conflicts between branches?
Isolation can offer greater near-term productivity (more
parallelism)
Trade off is the risk of instability introduced by the merge
(which increases with time-between-merge)
Merges can often need to flow both ways (reverse and
forward integration)
(Label Detour)
Branch by Label
Label Thoughts
Labels allow you to apply a marker to the current (or past)
state of a file or folder
Usually used to denote a milestone or release
You can apply multiple labels to a version of a file or
folder
Contents of a label can be edited after the fact (but no
version history of the label is maintained)
Team Build automatically assigns a label to the set of files
associated with each build that it creates.
Trivia: Label scope is a path within source control underneath which no other labels with the same name can
be created
When you use Source Control Explorer, scope = project root
Visualizing Labels
The contents of a label
is a set of changesets
Label Mechanics
In Source Control Explorer, right-click at appropriate
level and select Label to apply a label
To latest
Or by date
Or by changeset
(Or by label Build Dev Debug_20070319 is also Version 2.4)
Feature Branch
Isolate work on new or experimental features that might cause
instability to the rest of the project.
Isolate work on interface changes that will cause instability for
the rest of the project.
Release Branch
Branch for builds that will require you to perform ongoing
service/maintenance (sub-branch for hotfixes)
Branch to pursue/stabilize multiple releases in parallel
Considerations in Branching
Consider structuring branch trees so you only
need to merge up/down the branch hierarchy not
across
Avoids need for baseless merge (tf /merge baseless )
Remember that branch hierarchy likely doesnt match repository
and file system layout in terms of the tree
Merging a change back up to main line and down to another
branch requires care
Release 2
V.next work can happen in Dev branch once the release branch
has been created. Can be shelved temporarily until that
happens.
$//Dev
$//Test
$//Prod
foo.cs
12
14
15
19
21
25
bar.cs
10
15
16
20
22
25
foo.cs
13
17
23
26
bar.cs
13
17
23
26
foo.cs
18
24
27
bar.cs
18
24
27
Latest version
Label
Date
Changeset
Merging
Can merge by:
Selecting individual changeset(s)
Useful for handpicking bug fixes or changes to merge
Closed bugs (work items) will tell you which changesets are
associated fix/change
Must be a contiguous range of changes for a given merge
operation (ouch)
Keep your changesets fine-grained !
Merging
Merge includes content additions, deletions,
un-deletions, renames, movesnot just
changes between two files!
Merge operations can require conflict
resolution if development is occurring in the
merge target
Note that merge requires your workspace to
have visibility to all branches involved
Note that merge process itself doesnt
update the target branch on your local disk
but that is where merge will take place from !
Merging
Merge operations result in a set of pending
changes (of type merge) which must be
checked in (and will result in single
changeset)
Merge history maintained for you system
knows what the remaining merge
candidates are from branch parent to
branch child (unlike svn)
Agenda
Branching & Merging
Mechanics within TFS
Strategies
Agenda
Branching & Merging
Mechanics within TFS
Strategies
Unexamined
Development Staging/Accepted/Rejected
Test Staging/Accepted/Rejected
Production Staging/Accepted/Rejected
Database Refactoring
Schema comparison
Data generation tools
Database unit testing tools
Database projects
Ability to harvest all schema objects
from existing scripts or live schema
Triggers, functions, security elements,
sprocs, tables, view, constraints,
indexes, keys, triggers, UDT
House in a single project with both
script centric and schema
centric views
Thanks -