DekGenius.com
Previous Section  < Day Day Up >  Next Section

Recipe 6.13 Creating CVS Branches

6.13.1 Problem

You want to develop a new version of your code, such as a beta version, by creating a new branch in your development tree.

6.13.2 Solution

Add a new branch to your project's development tree by selecting Team Branch.

6.13.3 Discussion

CVS also enables you to create new branches in your code's development tree. Such branches can act as alternate streams of development for your code; e.g., you might want to develop a new version of your code that uses prompts in another language.

To create a branch, right-click a project and select Team Branch, which opens the Create a new CVS Branch dialog shown in Figure 6-19. In this example, we'll name the new branch Spanish_Version, as shown in the figure. At the same time, you can create a new version name for your code that will act as a reference, giving Eclipse a reference point for merging the branch into the main stream if you want to do that; Eclipse will suggest the name Root_Spanish_Version here.

Figure 6-19. Creating the Spanish_Version branch
figs/ecb_0619.gif


Clicking OK here opens the new branch in Eclipse, as shown in Figure 6-20 (note the project name in the Package Explorer).

Figure 6-20. A new branch
figs/ecb_0620.gif


You can check out the new branch from the CVS Repositories view, as shown in Figure 6-21.

Figure 6-21. The new branch in the CVS Repositories view
figs/ecb_0621.gif


You can merge branches back into the main development stream when needed. To do that, right-click the branch in the Package Explorer, and select Team Merge, which opens the Merge dialog shown in Figure 6-22. Select the merge point for this operation—in this case, Root_Spanish_Version—and click Next.

Figure 6-22. Selecting a root version to merge to
figs/ecb_0622.gif


The next dialog enables you to select the branch from which you want to merge. In this case, select Spanish_Version, as shown in Figure 6-23.

Figure 6-23. Merging a branch
figs/ecb_0623.gif


Clicking Finish in this dialog completes the merge operation.

    Previous Section  < Day Day Up >  Next Section