Retrospective CVS branching
Branching is a very useful concept in sources tracking. It allows to isolate some version of sources and continue with experimental development, bug fixing and anything else, which is better kept away from the main trunk. It’s generally simple to do branching when you have just decided to, but what if you are already two weeks (month or year) away from the version you wish to branch from?
Books on the subject:
- Essential CVS by Jennifer Vesperman
- Pragmatic Version Control Using CVS by Dave Thomas, Andy Hunt
If you wish to learn more about branches before continuing reading you can find many intersting information on official CVS manual site. I also would recommend this two great books on CVS and version controlling in general:
So I had exactly this task – to branch from the revision in the past. Unfortunately, the point I required to branch from had no tag. I knew only the date. And this is how my retrospective branching looked like:
Taking the version of sources at the given time (this morning, in particular)
$ cvs co -D2005-08-12 blogbridge
Tagging the beginning of a branch just in case we will need to merge the changes back to the trunk. If you have the root of the branch marked somehow it’s always easier to evaluate the changes performed between the initial revision of the branch and its HEAD.
$ cd blogbridge $ cvs tag release-2-0-br-root
Creating the branch.
$ cvs tag -b release-2-0-br
Switching to the newly created branch.
$ cvs up -rrelease-2-0-br
At this point I was ready to continue to work on this new branch and do my contributions safely. Exciting!