®
IBM Software Group
Essentials of Rational ClearCase
Getting Started
1
Software Development and Change
Software development involves change
A defect to be fixed
An existing function to be enhanced
A new feature to be added
A new platform to support
A customer-driven special project
Internationalization
2
Change Causes Developers Pain
Working in isolation, you can’t “see” code changes made
by team members
You can’t work in parallel on files that a co-worker is
modifying
You frequently lose time and have to redo work because of
lost defects or overwritten code
You have trouble determining which versions of the code
you should be working on
You have difficulty answering your manager’s questions
about project status
You don’t know who on the team is working on what
You have no idea which versions of files went into a build
3
Typical Developer ClearCase Workflow
4
Typical Workflow: Setting Up Your Workspace
5
What Is a Versioned Object Base (VOB)?
A permanent, read-only data repository that:
Stores files, directories, and
metadata
Stores version-controlled data
Displays its contents as files
in a file system
Stores anything that can be represented
as a file or directory
Can be replicated in two or more sites
6
What Is an Element?
A file or a directory, under source control,
stored in a ClearCase VOB
Can be any object that can be stored in a native
file system, including:
Source files
Directories
Binary files
Object libraries
Documents
7
What Is a Version?
An element consists of a set of versions, organized
into a version tree
Each version represents
one revision of a file
under source control
Versions are displayed
in a workspace or view
8
What Is a View?
A ClearCase mechanism that allows users access
to versions of elements in VOBs
An isolated workspace for a user or a group
Enables users to work in parallel
9
Types of Views
10
Which Type of View Should I Use?
Dynamic Snapshot
• You want to access • You are using Win 9X,
elements in repositories Win ME, or ClearCase
without copying them to LT, which do not support
your computer dynamic views
• You want the view to • You want to work
reflect changes made by disconnected from the
other team members at network
all times
• You do not need build
• Your project uses build avoidance
auditing
11
Structure of a Dynamic View
12
Structure of a Snapshot View
13
Intro to ClearCase Explorer
Folder Pane Details Pane
Shortcut
Pane
Information
Pane
14
Creating a Dynamic View
Base ClearCase
1
Launch the View
Creation Wizard.
2
Select Dynamic View.
Toolbox tab
15
Creating a Dynamic View (cont.)
3
Choose a view name (or view-tag).
4
Select a drive letter to which you want to
connect the new view, or you can select
{none} and work directly on the MVFS
(M:) drive.
5
Click Advanced Options.
6
Accept the default or
specify the location of
the view storage
directory.
16
Starting a View
Each view has a unique tag name
When you create a dynamic view, it starts automatically,
or you can start a different dynamic view
2
Select the view you
want to start, and then
click OK.
1
Click
Start View.
17
Dynamic Views Drive
When started, the
dynamic view always
appears under the
MVFS drive.
When you start a
view, it can also be
mapped to a logical
drive.
18
Mounting a VOB for Dynamic Views
The mount command activates a VOB for use on
the local workstation
You access a VOB through its unique tag name
19
Typical Workflow: Work on Files
20
Checkout/Checkin Model
When a file is under source control, you check it out to
work on it
A file is checked out to a
view and a modifiable
copy is available to work on
A placeholder is created in the
version tree as the potential
successor version
When you check in the file,
a new version is added to the
element version tree
21
View Before and After Checking out hello.c
22
Checking Out a File: ClearCase Explorer
23
Checking Out a File: Windows Explorer
24
Checking Out a File: Command Line Interface
Usage:
checkout | co [-reserved] [-unreserved pname] [-ptime]
[-branch branch-pname | -version] [-c comment | -cfile pname |
-cq | -cqe | -nc] pname ...
Example:
X:\Hardware\src>cleartool checkout hello.c
Checkout comments for “hello.c":
Bug fixing
You MUST end the
. comment by typing
“.” and Enter
Checked out “hello.c" from version
"\main\r2_int\alex_r2\2".
25
Versioning Directories
To change the directory namespace you must create
a new directory version
The ClearCase GUI automatically checks out a
directory and creates a new version if a change
occurs to the directory namespace (some operations
will prompt you to check out the directory)
Using the CLI, you must check out/check in a
directory to create a new version
To change only file contents but not the directory
namespace, you do not need to check out the
directory
26
Checking in a New Version
Adds a new version to the version
tree
Removes the read/write copy of the
file from the view storage area
The checked in version becomes
available to users using dynamic
views and to snapshot view users
upon the next update
Use ClearCase Explorer,
Version Tree Browser,
Windows Explorer, ClearCase
supported IDEs, or the CLI
27
What Is a Version Tree?
A hierarchical representation of an element in which
all versions are logically organized.
28
Viewing Versions of an Element Graphically
ClearCase graphically
depicts an element version
tree in the Version Tree
Browser
Version selected by
your view
29
What Are View-private Files?
Files that are not under ClearCase source control
Files that reside in the view; other users in other views
do not see them
Examples:
Temporary files created during development or testing
Files not yet added to source control
Read/write copies of files checked out of source control
30
Types of Checkout
Reserved checkout:
Default checkout
Has exclusive rights to next place on
version tree
No checkins can be made on the same
branch until the checkout is resolved
Only allowed if no other reserved
checkouts exist for the branch
Unreserved checkout:
Allowed regardless of the status of other
checkouts of the version
Before check in, must be merged or
discarded if any checkin has taken place
31
Resolving Checkouts
32
Non-Automatic Merges: The Diff Merge Tool
Merge results pane
Base contributor: Contributor 1: Contributor 2:
The original version The version that you The version that you
are delivering FROM are delivering TO
33
Using Diff Merge to Resolve Differences
Navigational Buttons: Merge Buttons:
Use to move between Click to move changes from the
merge points. first, second, or third contributor
pane to the merge results pane.
Red arrow:
Indicates where a
manual merge is
needed.
Difference Indicators:
Signify that content was added, removed,
or changed.
34
Adding Files to Source Control
As you work on a project, you may create view-
private files that you want to add to source control
You can add
Files
Directories
Add files
to source control
GUI — Add to Source Control
Command Line — mkelem
Utility — clearfsimport
35
Adding Files to Source Control (cont.)
When you add a file to source
control, ClearCase:
Determines the file type
Creates an element
Creates the /main branch and
an empty version 0
By default, checks in the element
and creates version 1
36
Adding Files to Source Control (cont.)
1
Select the items to add to
source control, right-click, and
then click Add to Source
Control.
2
Select to work on elements after you add them
to source control; clear to check in elements.
37
Adding Directories to Source Control
Add directories to source
control the same way you
add individual files
When you add a directory
to source control, files
within the directory remain
view-private
38
Comparing File and Directory Versions
ClearCase allows you
to compare element
and directory versions
Can compare a version
with predecessor or
with any other previous
version in the tree
In GUI, invokes
graphical Compare tool
that compares contents
of files and directories
39
Comparing File Versions
The Compare tool displays a graphical comparison of
text files.
40
Comparing Directory Versions
The Compare tool enables you to view, side-by-side,
the elements appearing in two versions of a directory.
41
Moving an Element
From ClearCase Explorer
only, drag and drop to
move elements within a
VOB.
42
Removing References to an Element
Remove the name of an element or VOB symbolic link
from a directory list
The element
still exists in
the VOB
43
Renaming an Element
Select element, right-click,
and then click Rename.
44
Removing an Element
Removes an element COMPLETELY from the VOB;
there is NO WAY to restore it
Removes all references to it in ALL
directory lists
You cannot remove elements that
have checked-out versions
To remove an element, you must
be the element owner, VOB owner,
or have ClearCase administrative privileges
45
Viewing an Element History
An element history is
recorded in event
records in the VOB
A ClearCase
operation, such as
Screenshot: Element
checkout, causes an history example
event record to be
created
Event records include:
who, what, when,
where, and comments
associated with the
event
46
Finding Checkouts
The Find Checkout tool enables you to search for
checkouts based on user-defined criteria.
47
Finding Checkouts
Based on selection criteria, ClearCase displays a list
of the checked out files in the Find Checkouts window.
48
Changing the Checkout Status
From the Find Checkouts window, you can change the
status of a checkout
To change the status of a checkout, you must be one of
the following:
ClearCase group member Element owner
VOB owner Element group member
49
Canceling a Checkout
Cancel a checkout when you do not want to save
changes or want a fresh copy
You can rename and save a view-private version of the
file: filename.keep. If you do not save the file, all
changes are lost
50
Canceling a Checkout
You can cancel a checkout from the Find Checkouts
window
Once you undo a checkout, your view selects the
predecessor version
51
52