Dealing with Version Branches
At Delver, like many other places, we use version branches to maintain releases. We have one trunk where everything gets integrated, and when we want to stabalize a release version, we create a version branch and do a ‘code freeze’ on this branch. On the version branch, only bug fixes are committed, and no new features are developed.
This process helps us stabilize versions within a matter of days and proceed quickly from trunk to QA to Production.
A problem we experienced with this process was it was hard to make sure all bugfixes were properly merged to trunk. The commonplace practice is to merge all changes from the version branch to trunk at the end of the release cycle (when the version is “frozen”).
There are at least two problems with this approach:
- First, it is usually one person who is left the ugly task of doing the merge of all these bugfixes that weren’t previously merged, usually in files he didn’t touch and knows nothing about.
- Second, if there are bugfixes on the version branch after the version is frozen, what is to guarantee they will reach trunk? The sad answer is “nothing” – we had several regression bugs because people forgot to merge their bugfixes).
Here is our NewAndImprovedProcess™ (as implemented by our very own Sergey Goncharov):
We setup a TeamCity build that monitors all version branches. It runs nightly, and examines the mergeinfo SVN property on all modified files. If it detects files that were committed to the version branch but weren’t merged to trunk, it fails and send an email to the responsible developer. A little convenience feature we sprinkled in was that if you have a change set that you really don’t want to merge to trunk, you can write in the commit note “[NO MERGE]” and the build will ignore this commit (you can also do a ‘recorded merge’, which is the proper SVN way of doing it, although adding the commit note is faster in a quick-and-dirty way).