0% found this document useful (0 votes)
118 views26 pages

Essentials of Rational Clearcase Module 2: Working With Files Under Source Control

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 a file, a new version is added to the element version tree.

Uploaded by

mnreddy
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
118 views26 pages

Essentials of Rational Clearcase Module 2: Working With Files Under Source Control

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 a file, a new version is added to the element version tree.

Uploaded by

mnreddy
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 26

®

IBM Software Group

Essentials of Rational ClearCase


Module 2: Working with Files Under Source Control

1
Objectives
Upon completing this module, you should be able to:
 Explain the checkout/checkin model
 Explain the difference between a reserved and
unreserved checkout
 Check out/check in files and directories
 Define version trees and branches and explain how
branches enable parallel development
 Edit a view config spec to automatically create a
branch

2
Typical Workflow: Work on Files

3
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

4
View Before and After Checking out
hello.c

5
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
6
Checking Out a File: ClearCase
Explorer

7
Checking Out a File: Windows Explorer

8
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
Checked out “hello.c" from version “.” and Enter
"\main\r2_int\alex_r2\2".

9
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

10
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

11
Resolving Checkouts

12
What Is a Version Tree?
A hierarchical representation of an element in which
all versions are logically organized.

13
Version-extended Names
 Each version of an element has a unique identifier
 The extended naming symbol denotes a path into
the version tree of an element
 @@ is the default extended naming symbol

14
Viewing Versions of an Element
Graphically
 ClearCase graphically
depicts an element version
tree in the Version Tree
Browser

Version selected by
your view

15
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

16
Branching Enables Parallel
Development
 Allows different projects to use the same source at the
same time
 Controls public/private work
 Isolates changes
 Temporary, such as new
features that have not yet
been tested
 Permanent, such as fixing
a bug in a retired release
 Prevents roadblocks — development can proceed
during an integration period
17
What Is a Branch Type?
 A user-defined name that forms a unique pathname in
the version tree
 Allows changes across multiple elements to be logically
grouped together
 Centralizes administrative control of branch names

18
Working on Branches
 When working on a project team, you will most likely work on
element branches other than /main
 A view config spec specifies which versions of the element
appear in the view
 Edit your view
config spec to
select the correct
branches and the
correct versions

19
The Default View Config Spec
 A default config spec is automatically set whenever
you create a new view

Rule 1
Rule 2

 Rule 1: Select version of element checked out to


THIS view
 Rule 2: If no version is checked out, select the latest
version on /main
20
Editing a View Config Spec
 You can edit the config spec to select versions on a
branch other than /main

Rule 1
Rule 2

 Rule 1: Select version of element checked out to


THIS view
 Rule 2: If no version is checked out, select the latest
version on the r2_int branch
21
Editing a Config Spec to Create
Branches
 A view config spec can use the –mkbranch clause to
create branches automatically upon checkout:

 Rule 3 is interpreted as:


 Select the version of the element with the R1 label
 During checkout , automatically create the r2_int branch
from the version labeled R1
 Check out the 0 (zero) version on the r2_int branch

22
Creating a New Branch Automatically
Change your config spec to create a branch when you
check out elements that have an R1 label.

23
Creating a New Branch Automatically
(cont.)

Before checkout into view After checkout; notice that


with the config spec using checkout created the
the auto mkbranch rule r2_int branch

24
Module Review
 How does ClearCase protect files from being
modified inadvertently?
 What happens when you check out a file?
 What is the difference between a reserved and an
unreserved checkout?
 When do you need to create a new version of a
directory?
 What happens when you check in a file?
 What is a version tree?
 What is a view default config spec?
25
Module Lab
 In this lab, you perform the following tasks:
 Edit a config spec to automatically create branches
 View an element version tree
 Check out/check in files
 Create a view-private file

26

You might also like