Introduction to clearcase branch

Posted on November 21, 2008

Overview

Clearcase branches are used to enable parallel development. A branch is an object that specifies a linear sequence of versions of an element. Every element has one main branch, which represents the principal line of development, and may have multiple subbranches, each of which represents a separate line of development. For example, a project team can use two branches concurrently: the main branch for new development work and a subbranch to fix a bug. The aggregated main branches of all elements constitutes the main branch of a code base.

Subbranches can have subbranches. For example, a project team designates a subbranch for porting a product to a different platform; the team then decides to create a bug-fixing subbranch off that porting subbranch. In a Rational® ClearCase® configuration, you can create complex branch hierarchies, for example, a multilevel branching hierarchy like that shown in below. As a project manager in such an environment, you need to ensure that developers are working on the correct branches. To do that, you must tell them which rules to include in their config specs so that their views access the appropriate set of versions.

When to create a Clearcase Branch

1.Users define additional branches in some of the elements, in order to isolate work on such tasks as
bug fixing, code reorganization, experimentation,and platform-specific development

2.The element is read-only,eg:mastership is owned by other site.

How to create clearcase branch

To create a branch, first of all, you have to create an Branch Type:

cleartool mkbrtype -c <comments> <branch_type>

eg:

cleartool mkbrtype -c "Branch for  Development Team"   bdt

The next step is assign the branch to the element:

cleartool mkbranch <branch_type> <element>

eg:

cleartool mkbranch BDT foo.c

To make branch with Config Specs

If your config spec has a /main/LATEST rule with a -mkbranch clause, mkelem checks out a subbranch instead of the main branch. For example, suppose your view

has this config spec:

element * CHECKEDOUT
element * .../gopher_port/LATEST
element * V1.0.1 -mkbranch gopher_port
element * /main/0 -mkbranch gopher_port

The /main/0 rule in the last line allows you to create elements. In this case, a gopher_port branch is created for the new element, and this branch is

checked out instead of main:

cleartool mkelem -c "new element for Gopher porting work" base.h
Created element "base.h" (type "text_file").
Created branch "gopher_port" from "base.h" version "\main\0".
Checked out "base.h" from version "\main\gopher_port\0".

The auto-make-branch facility is not invoked if you use the -nco option to suppress checkout of the new element. For more information about auto-make-branch,

see the checkout and config_spec reference pages in the IBM Rational ClearCase Command Reference.

Popularity: 10% [?]

» Filed Under Clearcase

Comments

Leave a Reply