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:
You can update to a certain tag. Use Advanced->Update to tag/date for this. The same procedure is used for updating to a branch. The command issued by Cervisia is
cvs update -r tag |
You can update to a certain date. This may be useful if an error was introduced in the project between two releases, you know approximately between, and have an opinion on when that was. You can go to some date by choosing Advanced->Update to tag/date and checking the box Update to date. In the field below, you can enter a wide variety of date formats. One possible format is yyyy-mm-dd where yyyy is the year, mm is the month (numerically) and dd is the day. Alternatives are some english phrases like yesterday or 2 weeks ago. When you use this option, Cervisia uses the command
cvs update -D date |
Both options above make a tag or date 'sticky', i.e. you can not commit further modifications on that files (unless the tag is a branch tag). In order to get back to the trunk, also known as the branch with the name HEAD, use the menu item Advanced->Update to HEAD. This results in a command
cvs update -A |
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 |