The K Desktop Environment

Chapter 4. Advanced usage

4.1. Tagging and branching

We discuss here only the technical aspects of tagging and branching. If you are only a user, not the administrator of the repository, you will probably not be confronted with the problem. If however you are your own administrator, you should first read about the non-technical problems that accompany branching, in order to get an impression of how time-consuming and error-prone maintaining different branches of a project can be. The appendix includes some references about this topic.

Simple tagging is something you usually do when a release is made, so that you can at any time easily get back to the project state at that time. Tags are usually given a name consisting of the project name and the version number. For example, Cervisia 1.0 is available under the tag CERVISIA_1_0. Cervisia enforces CVS's strict rules about what constitutes valid tag name. It must begin with a letter and may contain letters, digits, hypens and underscores.

Normally, you will want to tag the whole project (although CVS of course allows you to tag only a subset). To this end, mark the toplevel directory in the view and choose Advanced->Tag/Branch. Now enter the name of the tag, press Return and you are done!

Creating a branch is not significantly more difficult: In the tag dialog, check the box Create branch with this tag. You can also delete an existing tag: Choose Advanced->Delete tag in the main view.

There are several ways to update to a certain state of the project:


Figure 4-1. A screenshot of Cervisia's update to tag dialog


Another aspect of branching is the merging of modifications from a branch to the current branch. If you are going to do this, choose Advanced->Merge.... The dialog that appears now gives you two options:

Either you may merge all modifications done on a branch to the current branch. In that case, check the box Merge from branch and fill in the branch you want to merge from. Cervisia will then execute the command

 cvs update -j branchtag

The other possibility is that you want to merge only the modifications made between two tags on a branch. This usually happens when you merge from the same branch to the trunk several times. In that case, check the box Merge modifications and enter (in the correct order) the two relevant tags. This will result in a command

 cvs update -j branchtag1 -j branchtag2