Home 

Keeping different branches on the same machine

Whenever a configuration manager of the project decides to create a new stable release, the developers face a problem: they are not allowed to add new features to the software, only bug-fixes can be checked into the repository. Until the configuration manager opens the sources for further development, the developers are stuck.

To avoid this dilemma, the configuration manager creates a branch off the main development line when he creates the new stable release. Fixes will be made to the release-branch, new developments will be made to the main branch. This eliminates two problems: the configuration manager does not have to lock the current stage and the developers can continue with the implementation of features planned for the next release. Nevertheless, the stable version can be changed (fixes can be applied) and those fixes can be transferred to the main development branch so that they do not show up in future releases of the software.

Since in our project the developers will work on both, bug fixes and new development at the same time, it is convenient to have two sandboxes on the development machine. For the following examples, I have two subdirectories in my $HOME for the project. One is for the release and the other for the develepment branch. I name them stable for the release branch and devel for the development branch.

The development branch

The development branch is the same as you use it today. Just move it from it's current location to $HOME/devel. I kept it directly in my $HOME directory so I did it as follows:

Example A.7. Keeping stable and development branch on one machine


  thb:~> md devel
  thb:~> md stable
  thb:~> mv kmymoney2 devel
  thb:~> 


Now the development sources are found in ~/devel/kmymoney2/. It is important to move all the CVS directories as well. If you start from scratch, then you just follow the instructions on how to checkout the project and do that in the devel subdirectory. See the chapter Checking out from the repository for an example.

The release branch

As soon as a release branch has been created by the configuration manager, you should get it to the stable directory. You do this by checking it out with the tag that has been assigned. The conventions have been defined in the chapter about Version management. For this example, I assume that a release branch for version 0.4 exists in the repository. [1]

Example A.8. Checking out the stable branch for the first time


  thb:~> cd stable
  thb:~/stable> cvs -d username@kmymoney2.cvs.sourceforge.net:/cvsroot/kmymoney2 \ [2]
                co -r rel-0-4-branch kmymoney2
  thb:~/stable> 


At this point it is important to use the branch-tag to be able to modifiy the files and check them back into the repository. If you are in the subdirectory containing the release-branch and you perform a cvs update, you will only get those changes, that were made on the branch. Also, changes are checked back into the release branch and do NOT show up on the development branch.

Note

If you want to keep more than one stable branch on your development machine, you can add the version number to the stable directory (e.g. stable-0.4, etc.)



[1] Guess when I wrote this chapter ;-)

[2] The back-slash is inserted here to break the line for readability. For real usage, the command has to be entered on a single line.