Maintnence using CVS Branch 

This is an example of how to create a Fusion Client Release Branch. This example will show the following steps:
  • Create A Branch in CVS and locally
  • Tag release files correctly
  • Commit release branch source code with bug fixes
  • Merge release branch bug fixes into other branches

Create a Branch in CVS

This example will create the Client Release 2005_1_10_0 production branch RB_2005_1_10_0

1. Make sure you have everything checked in

C:\work\dotnet\FusionClient\FusionR2a>cvs commit -m ""
cvs commit: Examining .
cvs commit: Examining Docs
cvs commit: Examining Docs/FusionObjectPatternExample
...

2. Create a Branch for the new release

C:\work\dotnet\FusionClient\FusionR2a>cvs rtag -b RB_2005_1_10_0 FusionClient/FusionR2a
cvs rtag: Tagging FusionClient/FusionR2a

3. Checkout the current sourcecode into a new working directory

This will create the new directory C:\work\dotnet\FusionClient\Fusion2005_1_10_0\ and checkout the RB_2005_1_10_0 branched version of code into it.
 
C:\work\dotnet\FusionClient>cvs co -P -r  RB_2005_1_10_0 -d Fusion2005_1_10_0 FusionClient/FusionR2a
cvs server: Updating Fusion2005_1_10_0
U Fusion2005_1_10_0/AssemblyInfo.cs
U Fusion2005_1_10_0/Copy App.Config to Einstein.exe.config and abt.exe.config.cmd
U Fusion2005_1_10_0/FusionR2a.sln
U Fusion2005_1_10_0/MVC construction.vsd
U Fusion2005_1_10_0/Microsoft.ApplicationBlocks.ExceptionManagement.Interfaces.dll
U Fusion2005_1_10_0/Microsoft.ApplicationBlocks.ExceptionManagement.dll
U Fusion2005_1_10_0/Wachovia.Retail.Fusion.ApplicationUpdater.Interfaces.dll
...
...
...

4. Move to the new checked out directory

c:\work\dotnet\FusionClient>cd Fusion2005_1_10_0

5. Verify All Unit Tests Are Working

At this point, the developer will want to ensure that all files were checked out correctly. This can be done by running a complete set of unit tests for the client.

At this point, the code in the relase branch and the code in the main branch are the same. (Since the code has not changed on both branches). The branch code is no longer refered to buy the REL_ tag but rather by its RB_ branch tag.

Fixing Bugs in a Release Branch

The key to utilizing the branch is to allow for bug fixed in a version of the code but ensuring that all branches get updated with the code change once the bug has been fixed. It is assumed that if this version of the code has the bug, the other branches probly have it as well. With version control, we can control the process better. We do this by getting the version control system to keep track of the source code changes made while fixing the bug, and then merging those changes in to the code in other affected branches.

1. Check out a copy of the branch containing the bug into your workspace

C:\work\dotnet\FusionClient>cvs co -r RB_2005_1_10_0 -d CurrentRelease FusionClient/FusionR2a
cvs server: Updating CurrentRelease 
...

2. Tag the repository with a pre-fix tag

Using the identified Test Directory defect id, tag the branch release with the following naming convention: (PRE_DefectID) example: PRE_501, PRE_1002
C:\work\dotnet\FusionClient\CurrentRelease>cvs tag PRE_501
cvs server: Tagging .
T App.ico
T AssemblyInfo.cs
...

3. Generate a unit test to reveal the bug, fix the code a verify the build

Create a unit test that will fail due to the bug. Fix the bug and verify the unit test no longer fails.

Commit your changes back into the repository

C:\work\dotnet\FusionClient\CurrentRelease>cvs commit -m "Fixed Defect 501"
cvs commit: Examining .
? obj
? bin
? RicardosDebug.csproj.user
Checking in CVSTestClass.cs;
/emrcvs/FusionClient/FusionR2a/RicardosDebug/CVSTestClass.cs,v  <--  CVSTestClass.cs
new revision: 1.1.4.2; previous revision: 1.1.4.1
done

4. Tag the repository with a post-fix tag

Using the identified Test Directory defect id, tag the branch release with the following naming convention: (POST_DefectID) example: POST_501, POST_1002
C:\work\dotnet\FusionClient\CurrentRelease>cvs tag POST_501
cvs server: Tagging .
T App.ico
T AssemblyInfo.cs
...

5. Merge bug fix code into affected branches (potentially including the mainline branch)

C:\work\dotnet\FusionClient\CurrentRelease>cd ..\FusionR2a
C:\work\dotnet\FusionClient\FusionR2a>cvs update
cvs server: Updating .
...

C:\work\dotnet\FusionClient\FusionR2a>cvs update -j PRE_501 -j POST_501
RCS file: /emrcvs/FusionClient/FusionR2a/RicardosDebug/CVSTestClass.cs,v
retrieving revision 1.1.4.1
retrieving revision 1.1.4.2
Merging differences between 1.1.4.1 and 1.1.4.2 into CVSTestClass.cs

6. Unit Test other branch after merge is complete

7. Commit Changes to CVS for other branch

C:\work\dotnet\FusionClient\FusionR2a>cvs commit -m "Apply fix for Defect 501 from RB_2005_1_10_0"
cvs commit: Examining .
...
  
Copyright 2003 Counterpoint Designs, Inc. | Designed and Hosted by Counterpoint Designs
Powered by Counterpoint Designs Collaborate Portal Engine    Terms Of Use    Privacy Statement
Portal engine source code is copyright © 2002-2010 by DotNetNuke. All Rights Reserved