Transcript
Page 1: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

ClearCase TrainingJanuary 2005

Cairo Clearcase TeamCairo, Egypt

Amr ElhusseinyIT Manager

Page 2: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 20042

Clearcase support at Mentor Graphics

Europe/middle east North America

Amr ElhusseinyAmr Elhusseiny

Asser SherifAsser Sherif

Ahmed FayekAhmed Fayek

Richard EnglandRichard England

Roger MooreRoger Moore

Cairo-EgyptCairo-Egypt WV-USAWV-USA

Page 3: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 20043

Page 4: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 20044

General Concepts Using ClearCase On UNIX Using ClearCase On Windows How To work From Home (snapshot) Build Control UCM On Unix UCM On Windows

ClearCase Training

Page 5: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 20045

Configuration Management (Concepts and Goals)

Data Storage – VOBs

Meta-Data for Process Control

General Concepts

Page 6: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 20046

“General Concepts” Configuration Management Concepts Tracking objects and changes to the objects Tracking the relationships and changes to the

relationships between objects, Ex: o Unit tests and source o Source and requirements o Documentation and source

Tracking environment information, i.e. the versions of tools used to build, etc.

Tracking defects forcing changes to requirements, source, documentation, and tests

Parallel development Being able to reproduce previous releases exactly

Page 7: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 20047

Improve the Return on Investment by:

Increasing team productivity

Increasing product quality

Managing process quality

Reducing the time to market

Reusing code when applicable

“General Concepts” Configuration Management Goals

Page 8: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 20048

“General Concepts”

Data Storage – VOB(Versioned Object Base)

This is the repository where all objects (and information about those objects) is stored.

A VOB is made up of a database and storage pools.

The database contains information about elements, derived objects, cleartext, and meta-data).

The storage pools contain the file system objects for the elements in the VOB.

An element is a file or directory.

Page 9: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 20049

“General Concepts” Data Storage – VOB

(Versioned Object Base), Cont. Cleartext is a cached version of a previously selected

version of an element. A derived object is an object that was created by either a

clearmake, omake, build or audit. Meta-data are bits of information that you can associate

with elements. The storage pools are subdirectories that contain the file

system data for the VOB.

The element source is stored in the s pool, cleartext

in the c pool, and derived objects in the d pool.

Page 10: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200410

“General Concepts”

Data Storage - Registries

Registries contain information about VOBs and the

way the VOBs data is accessed (a view).

The registries contain typically:

A unique identification number

The object's name

Its storage path

Where the object is accessible (its region)

Page 11: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200411

“General Concepts”

VOB Elements (files and directories) Each element is made up of

versions, which make up the revision history of the element.

myfile.c was created resulting in version 0. It was then modified and checked in, resulting in version 1. To create version 2, it was checked out and back in.

All the work was done on the main branch of the element.

Page 12: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200412

“General Concepts”

Accessing VOB Data Using a View A view is a collection of rules or filters applied in a

specific order to produce the specific versions of the elements that you see.

In different views, the versions of the elements and the elements that one user will see may not be the same as what another user will see, even though they are looking at the same directory structure.

The rules that the view uses are set in the configuration specification. (most commonly referred to as a config spec).

Page 13: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200413

“General Concepts”

Accessing VOB Data Using a View, Cont.

Page 14: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200414

“General Concepts”

Metadata For Process Control

Labels

Attributes

Branching

Hyperlinks

Element Types

Triggers

Locks

Page 15: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200415

“General Concepts”

Labels Identify specific versions of files. Use labels to mark milestones in project development. Lock them to prevent elements being added or removed

inappropriately. Apply labels to “directory elements” if any element in the

directory will have the label applied to it. Avoid labeling versions on branches that are only version

0. Follow the corporate naming convention for labels:

— Label names are all uppercase — Labels use periods and numbers to denote versions

Page 16: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200416

“General Concepts”

Attributes Use attributes to mark states in project

development.

Attributes consist of a name and value pair Example: attribute State has values of "None",

"Working", "Fixed", "Tested", "Verified"

Users can query the VOB database to find elements with specific attribute and specific value.

Page 17: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200417

“General Concepts”

Branching Use branches to monitor how changes affect the source tree.

Using branches properly allows changes to be checked into the source tree without affecting nightly builds.

Better not allow development to be done on the /main branch, instead use task branches off the /main branch, and then developer branches off the task branch.

Only allow the VOB owner, build person, or specifically designated person to merge to the /main/LATEST once the code on the branches have been tested by the individual developer. Using branches this way complements the check in policy.

Lock release or task branches at appropriate times in the development cycle.

Follow the corporate naming convention for branches. — Branch names are all lowercase. — Branch names use periods and numbers to denote versions

Page 18: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200418

“Using VOBs and Views” Branches and Parallel Development

/main

0

1

2 C4

myfile.c

0

/bugs

2

0

1

0

1

/enhancements

/bug104

1

Label

Branch

Merge

Page 19: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200419

“Using VOBs and Views” Branches and Parallel Development, Cont.

All elements have at least one branch, /main. Changes are normally done to the last version of the element on a specific branch

Changes can be done to other versions than just the last version on a branch, but the config spec must be set up properly.

You need to know exactly which version you are selecting, and therefore which version you will be branching from.

Page 20: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200420

“Using VOBs and Views” Branches and Parallel Development, Cont.

Using other than the /main branch only affects those views with config specs that use the alternative branch allowing changes to be isolated.

Users can define branches to correspond to the work that they do. For example, the dr123456 branch would contain all the work done to fix DR123456.

Branches are used to allow multiple developers to check out the files, modify them, and check the files back in without affecting other developers

Page 21: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200421

“General Concepts”

Hyperlinks

Use hyperlinks to show the relationships between objects. Use hyperlinks liberally

Show the relationships between:

— Requirements documents and source files — Source files and tests — Source files and documentation — Tests and data files

Page 22: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200422

“General Concepts”

Hyperlinks, Cont.

2 1 1

23

/main

0

1 0/bugfix

/main

0

1 0/bugfix

myfile.c myfile.doc

QA_LINKQA_LINK -> /vob/project/myfile.doc

@@/main/bugfix/2

QA_LINK <- /vob/project/myfile.c @@/main/bugfix/1A hyperlink is an annotation that depicts a

relationship between two objects

Page 23: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200423

Mentor Hyperlink Usage

Hyperlinks are usually coupled with triggers on specific operations to send email to affected team members when changes occur.

Examples of hyperlink usage are: — Requirements documents and source files — Requirements documents and tests — Requirements documents and documentation — Source files and tests — Source files and documentation — Documentation and tests

Page 24: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200424

“General Concepts”

Element Types

Use element types to distinguish between types of elements. Predefined types are:

— file - stores any data — compressed file - store any data, using the gzip compression

program — text_file - store text using incremental deltas — compressed_text_file - store text, using incremental deltas and

gzip — binary_delta_file - store any data using both gzip and

incremental deltas — directory - compare and merge directory versions

Users can create their own types to differentiate between source file types, i.e. C_src, C_Inc, Perl_src.

Page 25: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200425

“General Concepts”

Triggers Help to monitor processes. Examples: prevent certain

users from performing certain operations.

Use triggers to control the development process

Triggers can execute before or after the specified command — Verify conditions are met prior to execution — Prevent unauthorized individuals from executing commands

Triggers can execute after the specified command — Send notifications to concerned project members — Apply meta-data to elements if specified criteria is met

Page 26: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200426

Mentor Trigger Usage

Triggers to control the development process, by firing before and/or after a command. They can govern the use of the following commands by using some or all of the examples:

— rmelem, rmname, rmver Only allow the VOB owner to remove elements, file elements

from directory elements, or element versions. — rmtype, rmhlink, rmmerge

Only allow the VOB owner to remove type definitions Under no circumstances allow the removal of merge arrows

(hyperlinks of type MERGE).

Page 27: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200427

Mentor Trigger Usage, Cont.

— mkelem, mkbrtype, mklbtype At creation time change the ownership and permissions for all

new elements, branch types, element types, and label types to the VOB owner.

For elements, force that a hyperlink be created to a requirements document.

— mklabel Only apply labels to the proper files by using the query

language or "mklabel -config". Lock labels to prevent modification

Page 28: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200428

“General Concepts”

Locks Use locks to mark milestones in project development and

to prevent changes to objects. Locks can be applied to:

— Labels — Elements — Attributes — Branches — Types

Apply locks to directory elements to prevent new elements from being added.

Avoid locking versions on branches that only contain version 0.

Page 29: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200429

“General Concepts”

Using VOBs and Views

View types and their differences

Using Config specs

Page 30: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200430

“Using VOBs and Views” View Types and Their Differences

Config Specs Rules

VOB

Versioned Object Base

DYNAMIC VIEW

SNAPSHOT VIEW

Config Specs Rules

VIEW Files VIEW Files

Page 31: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200431

“Using VOBs and Views” View Types and Their Differences, Cont.

Views should be treated as disposable items. It is best to create a view for each task. Only use ClearCase commands to remove views.

There are two types of views, snapshot and dynamic. Each view type has different capabilities and

requirements. However, there are similarities as well. For example, both view types make use of the configuration specification as a means of controlling which files that are visible. And, both have view storage areas and databases to keep track of the files.

Page 32: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200432

“Using VOBs and Views” View Types and Their Differences, Cont.

Snapshot Local files (no network dependencies) Increased performance when accessing Unix VOBs from Windows Files are downloaded from the VOB server to the client as specified in the

config spec. Are not updated automatically, but can be updated via command line or

graphical user interface. Can be shared the same way any Windows directory can be shared.

Page 33: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200433

“Using VOBs and Views” View Types and Their Differences, Cont.

Dynamic Update immediately to potentially see any changes to elements as soon as

the changes are checked in from another view, assuming the view is configured to see the changes.

Use build avoidance to get matching objects from other views Both have view storage directory structures that contain a database to

keep track of view private files (elements that are in the view but not in the VOB and elements that have been checked out or hijacked), and derived objects produced in the view. The database also contains the group access list for the view.

View permissions are governed by the umask of the view owner on Unix, and the ACLs of the view owner on NT.

Page 34: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200434

MultiVersion File SystemMVFS

Dynamic Views are based on MVFS MVFS provides read-only files from CC VOB to Dynamic View

without copying files to View MVFS Supports the Operating System’s file system interface,

same is done by NFS, NTFS, FAT,.. (Native OS File Systems) Difference: MVFS Understands Versions, it opens the file version

selected by user’s view Any Application (VI, WORD,..) can retrieve this file version

transparently MVFS enables Build Auditing (Track what files are opened

during build process)

Page 35: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200435

“Using VOBs and Views” Using Config Specs

Config Spec rules are what views use to determine which elements will be visible to the user. These rules are applied in the order specified to every element  in the applicable VOBs. 

If the first rule does not match, the next is applied and then the next and so on until a match is found or there are no more rules.

Usage tip:— Keep the number of config spec rules to an absolute minimum.

Four rules should be adequate for most tasks. — Avoid the unnecessary complexity of adding specific elements or

versions of elements, Instead, use different views for different tasks.

Page 36: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200436

“Using VOBs and Views” Using Config Specs, Cont.

The syntax for a config spec rule is:

scope     pattern      version selector     [optional clause] scope, specifies what elements or types of elements the rule is for,

elements, elements that are files,  elements that are directories, or elements that are a user defined type.

pattern, specifies the pathname to use. Generally, wildcards like '*', '*.c', and '/vobs/myvob/utils*' are used.

version selector,  specifies which version of the elements to use. This can be a specific version like /main/2 or /main/mybranch/3. It can also be one chosen by a label like CHECKEDOUT or LATEST or even an attribute like {created_since(yesterday)}.

Config spec can contain comments also. Any line beginning with a '#' is treated as a comment

Page 37: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200437

“Using VOBs and Views” Using Config Specs, Cont.

Config specs, examples:

element * CHECKEDOUT

element * .../mybranch/latest

element *.c RELEASE_2.0

element * /main/latest -mkbranch

mybranch

Page 38: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200438

“Using VOBs and Views” Using Config Specs, Cont.

Config Specs, Special Rules Example: mkbranch/end mkbranch: Tells the view that

when a check out affects an element that is selected by the corresponding rule to make a branch for the element. By coupling this command with end mkbranch this rule can affect a subset of the rules in the config spec.

Load: Applies only to snapshot views, and specifies what paths in a VOB should be included in the view.

Page 39: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200439

“Using VOBs and Views” Using Config Specs, Cont.

Build and test engineers should use something like:

element * LABELNAME

Working on snapshot view:

load /vobs/<VOB_TAG>

element * CHECKEDOUT

element * /main/LATEST

Developers should use something like:

element * CHECKEDOUT

element * .../mybranch/LATEST

element * LABELNAME -mkbranch mybranch

Page 40: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200440

Checkout / Checkin Model

Checkout

myfile.c

VOB

Versioned Object Base

DYNAMIC VIEW

Config Specs Rules

VIEW Files

Checkin

File elements are read-only until they are checked-out

Page 41: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200441

Checkout / Checkin Model, Cont.

Types of Checkouts

Reserved Checkout (Default)— Ensures that no checkins may be made until the reserved checkout

is checked back in or cancelled— May only be made if no other reserved checkouts exist for the

same branch

Unreserved— Can be made regardless of the status of other checkouts on the

branch— Can be checked in if no reserved checkouts have been made in the

interim, and no other unreserved checkouts have been checked in— Must be merged or discarded if a checkin from another view has

already taken place

Page 42: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200442

Checkout / Checkin Model, Cont.

3

R U

3

R U

4

3

R

3

4

RESERVED Checkout UNRESERVED Checkout

Checkout

Checkin

Checkout Checkout

Checkin

This UNRESERVED checkout must merge before check in

new version 5

Page 43: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200443

Mentor Check In/Out Policies

Check ins: since the view servers and individual workstations are

not backed up, check ins should be performed daily on the developer or task branch. Doing this ensures the changes are in the VOB.

Check outs:

since ClearCase allows you to see the entire file system without checking out the elements, it is unnecessary to check elements out to see them. And, it will be easier to keep track of the changes mentally if elements are checked out only as needed.

Page 44: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200444

Mentor Naming Conventions

Label names:

are all uppercase and use periods to denote versions i.e. RELEASE_BUILD.4

Branch names:

are all lowercase and use periods to denote versions

View-tags: are all lowercase and do not use periods All private branches should follow the convention: a userid

followed by "_pvt" and then a period followed by the branch version number, i.e., jsmith_pvt.4.

Some project specific conventions can be added for clarity and convenience for project members.

Page 45: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200445

Mentor View Usage

Create one view for each developer to avoid view registry problems.

Keep the number of config spec rules to an absolute minimum.

— At most, four rules should be adequate for most tasks, generally fewer will suffice.

— Avoid the unnecessary complexity of adding specific elements or versions of elements.

Page 46: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200446

Using ClearCase On UNIX

Page 47: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200447

Base Clearcase under Unix

Page 48: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200448

Requirements and settings

To start working with Clearcase under Unix you need to do the following:

— Log on a machine on which ClearCase client is installed

— Add /opt/rational/clearcase/bin to your PATH

and /opt/rational/clearcase/doc/man to your MANPATH

— Adjust your umask to a suitable permissions for you and your group ( e.g. umask 2 )

Page 49: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200449

Umask

umask command is used to get or set the file mode creation mask

An example of the output produced by 'ls -l' is shown below:drwx------ 2 richard staff 2048 Jan 2 1997 private drwxrws--- 2 richard staff 2048 Jan 2 1997 admin -rw-rw---- 2 richard staff 12040 Aug 20 1996 userinfo drwxr-xr-x 3 richard user 2048 May 13 09:27 public

In most cases the default Umask settings is ‘022' and can be checked by typing “umask” at the command prompt

This default setting produces permissions of “755” for files and directories creation: -rwxr-xr-x for regular filesdrwxr-xr-x for directories

Page 50: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200450

Umask cont…..

To change the umask use the command “umask #” at the command prompt, where # represents the new umask you want to use

For example, use the command “umask 2” to create files

and directories with permissions “775”: -rwxrwxr-x for regular filesdrwxrwxr-x for directories

Page 51: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200451

Find Your Way

List all VOBs> cleartool lsvob* /vobs/TNT_pfgen /net/egccc1/export/vobs/vobstore/TNT_pfgen.vbs public

* /vobs/IT_VOB /net/egccc1/export/vobs/vobstore/IT_VOB.vbs public

/vobs/icx_software /net/egccc1/export/vobs/vobstore/icx_software.vbs public

* Denotes VOBs mounted on current ClearCase client.

List all VIEWs> cleartool lsview* amre_TNT_vu /net/egccc1/export/vobs/views/username_TNT_sco_vu.vws

assers_develop_vu /net/egccc1/export/vobs/views/mselim_develop_vu.vws

* Denotes VIEWs currently in use.

Page 52: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200452

Create your Dynamic UNIX VIEW

Storage location plkviews already created on the filer CHOPIN for hosting the dynamic views for UNIX

> umask 2 ( to set permissions to 775 if required)

> cleartool mkview -tag your_view_tag –stgloc plkviews

Created view.

Host-local path: chopin:/vol/vol2/plkviews/your_view_tag.vws

Global path: /net/chopin/vol/vol2/plkviews/ your_view_tag.vws

It has the following rights:

User : username : rwx

Group: plk : rwx

Other: : r-x

Page 53: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200453

Create your Snapshot Unix View

For each user’s machine, a storage location needs to be created by the CC support team, the standard naming is:

machine-name_team-name_viewstore

A scratch area on the machine where the storage location is created needs to be shared so that it can be accessed from the path

/net/machine-name/scratch-area

Page 54: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200454

Create your Snapshot Unix View

To create the snapshot view in the storage location created in the scratch area on your local machine use:

>cleartool mkview –tag your_view_tag -snap –stg storage_location_name \ /net/your_machine_name/path_to_your_scratch_area/your_View_Tag

Example:

> cleartool mkview –tag amre_test_vu –snap –stg md8_IT_viewstore /net/md8/export/home/users/amre/views/amre_test_vu

Page 55: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200455

Working with Dynamic Views

Set a dynamic view to be your current VIEW

>cleartool setview your_view_tag

Print your current dynamic VIEW

>cleartool pwvWorking directory view: ** NONE **Set view: your_view_tag

NEVER remove the view using UNIX command rm –rf

Page 56: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200456

Config Spec – Dynamic View

View your configuration specs>cleartool catcs

element * CHECKEDOUTelement * /main/LATEST

Edit your configuration Specs>cleartool edcs

element * CHECKEDOUTelement * /main/LATEST

Set config spec for view “view-tag” ? [Yes]

Set configuration Specs file >cleartool setcs file_name

Page 57: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200457

Working with Snapshot Views

To set a Snapshot view to be your current view all you need to do is to CD to the path of the snapshot view you created, example:

> cd /net/md8/export/home/users/amre/views/amre_test_vu

Next thing you need to do is to load the needed directories and files from the VOB

Page 58: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200458

Adding or Modifying Load Rules

You can add or modify load rules in any of the following ways:

Any time you edit and modify a snapshot view’s config spec, ClearCase updates the entire view. This is appropriate when you first create a view, or when you modify a view’s version-selection rules, but it may be cumbersome if you only want to add a few elements to the view

 By using update –add_loadrules. The –add_loadrules option of cleartool update adds load rules to your view’s config spec but updates only the portion of the view that is affected by the new load rules

Page 59: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200459

Add Load Rules When Editing the Config Spec

Open the view’s config spec for editing by doing the following:— Open a shell and change to a directory in the view (Where the elements will be loaded

from VOB).— Use the following command to edit the config spec file:

> cleartool edcs

ClearCase opens the view’s config spec in your default text editor

In your text editor, use the following syntax to create load rules:

load vob-tag/element-pathname

For example, the rule load /vobs/testvob loads all files and directories in theVOB named /vobs/testvob.The rule load /vobs/testvob/batch loads only the batch directory recursively. Save the config spec and exit the text editor. In your shell, answer Yes at the ClearCase prompt for setting the config spec.

 

Page 60: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200460

Add Load Rules with update –add_loadrules

Use the following command:

> cleartool update –add_loadrules element-pathname

Where, element-pname: names an element in the VOB namespace at a pathname that is relative to a snapshot view.

For example, the following command loads all elements in a VOB named /guivobinto the view pat_v1.4_cropcircle_sv:

> cleartool update –add_loadrules ~/pat_v1.4_cropcircle_sv/guivob

You can also use a relative pathname for the element-pathname argument. For example, these commands load all elements in the vob guivob:> cd ~/pat_v1.4_cropcircle_sv> cleartool update –add_loadrules guivob

These commands load only the batch directory recursively:> cd ~/pat_v1.4_cropcircle_sv> cleartool update –add_loadrules guivob/batch

Page 61: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200461

Excluding Elements from Loading

ClearCase loads all directory elements recursively. To exclude some elements from loading, you can use an element rule in the config spec that selects an element’s initial version. For all ClearCase elements, the initial version contains no data..

To Exclude Elements you have to open the view’s config spec for editing— Open a shell and change to a directory in the view— Use the command

> cleartool edcs— In the text editor, create an element rule that specifies the initial version of the

element you want to exclude by using the following syntax:

element vob-tag/element-pathname /main/0 For example, the element rule element /guivob/interface /main/0 loads the empty

version of the interface directory in /guivob, preventing any of its child elements from loading.

Save the config spec and exit the text editor. In your shell, answer Yes at the ClearCase prompt for setting the config spec.

Page 62: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200462

Updating a Snapshot View

The rules in your view’s config spec are usually designed to select a discrete set of versions from the VOB. For example, your view is usually intended to contain a set of versions that build successfully. However, when other developers check in new versions from their views, a snapshot view may become out of date or inconsistent with the versions in the VOB

To make sure that your view contains the set of versions the config spec selects, you must update it

An update operation copies versions of elements from a VOB to your view. Only the checkin operation copies changes from your view back to a VOB

Page 63: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200463

Updating the View

You can start an update operation for:— The entire view— At least one file or at least one directory tree

To update the view, use cleartool update with any of the following options:

> cleartool update command-options snapshot-view-pathname

The snapshot-view-pathname argument is optional if you enter the update command from the root directory of the view

For a description of all available command options, see the update reference page in the Command Reference

Page 64: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200464

Updating the View

For example:

> cleartool update ~/pat_1.4_cropcircle_sv

  NOTE: You can use the Update Tool to update the view instead of

the command line. To start the update GUI, use the following command:

 

> cleartool update –graphical snapshot-view-pathname

Page 65: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200465

Updating Files and Directory Trees

To save time, you can update individual files or directories. (Rational ClearCase updates directories recursively.) Updating only specific parts of your view may eventually cause the view to contain an inconsistent set of versions

Use the following command:

 

> cleartool update command_options pathnames-of-loaded-elements

  NOTE: You cannot update a checked-out file. To undo changes to

a checked-out file and start over with the version in the VOB, cancel the checkout

Page 66: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200466

Unloading Elements

If a view’s config spec no longer selects an element, ClearCase removes, or unloads, it from the view. Unloading does not affect view-private files or view-private directories

Updating can cause an element to be unloaded from a view in the following situations:

— You remove the load rule that specifies the element (or that specifies a directory element somewhere above it)

— The version-selection rules no longer select any version of the element. This can happen when your config spec selects a version of the parent directory that no longer contains a version of the file element

Page 67: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200467

Unloading Files

The action that ClearCase takes to unload a file depends on the file’s current state:

— For a file that is not checked out, ClearCase deletes the file from the view

— For a hijacked file, ClearCase appends .unloaded to the file name, unless you use update –overwrite to delete hijacked files

— For a checked-out file, ClearCase appends .unloaded to the file name. The version remains checked out to your view

Page 68: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200468

Unloading Directories

ClearCase unloads directories recursively. To unload a directory element, ClearCase unloads the files in the directory. If any view-private objects, hijacked files, or checked-out files are in the directory, or if the directory is currently in use (for example, if your current working directory is in or below the directory) ClearCase appends .unloaded to the name of the directory

For example, if the directory src contains view-private files, ClearCase renames the directory to src.unloaded

Page 69: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200469

Working in a Snapshot View Without the Network (Laptop)

If you need to work with your source files from a computer that is disconnected from the network of Rational ClearCase hosts and servers, you can set up a snapshot view for disconnected use

This includes the following tasks:— Setting up a view — Preparing the view— Disconnecting the view— Working in the view— Reconnecting to the network— Using the Update Tool

Page 70: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200470

Working in a Snapshot View Without the Network (Laptop)

While on network:— Update the view from the VOB— Check out the files you intend to work on offline— Deactivate clearcase integrations

Disconnect from Network:— Use windows explorer to modify the checked out files in the snapshot view

location— If you want to modify non-checkedout files, there is a way to do so and

they are considered hijacked

  Connect to network:

— Reactivate clearcase integrations— Find the files modified while disconnected and also hijacked files— Check in all files to the VOB—  Update your view from the VOB with any changes done on VOB while you

were offline

Page 71: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200471

Working with Vobs

List files in a VOB>lsfile_name archive db test_data test_log version

>cleartool lsfile_name@@/main/1 Rule: /main/LATESTarchive@@/main/1 Rule: /main/LATESTdb@@/main/1 Rule: /main/LATESTtest_data@@/main/1 Rule: /main/LATESTtest_log@@/main/1 Rule: /main/LATESTversion@@/main/4 Rule: /main/LATEST

>cleartool ls -longversion file_name@@/main/1 Rule: element * /main/LATESTdirectory version archive@@/main/1 Rule: element * /main/LATESTdirectory version db@@/main/1 Rule: element * /main/LATESTdirectory version test_data@@/main/1 Rule: element * /main/LATESTdirectory version test_log@@/main/1 Rule: element * /main/LATESTversion version@@/main/4 Rule: element * /main/LATEST

Page 72: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200472

Working with Vobs..Cont

List version of a file in a VOB

>cleartool lsvtree file_namefile_name@@/main

file_name@@/main/4

>cleartool lsvtree –all file_namefile_name@@/main

file_name@@/main/0

file_name@@/main/1

file_name@@/main/2

file_name@@/main/3

file_name@@/main/4

Page 73: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200473

Working with Vobs..Cont

View different versions of a file in a VOB

>cat file_name@@/main/3

>cat file_name@@/REL2

>cat file_name@@/main/LATEST

Page 74: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200474

Checkout / Checkin Files

Checkout a file>cleartool checkout myfile.cCheckout comments for “myfile.c”Fix Bug 102..Checked out “myfile.c” from version “/main/3”.

List Checked out files>cleartool lscheckout –me (By current login)

>cleartool lscheckout –cview (In current VIEW)

>cleartool lscheckout –all (All files in VOB)

Page 75: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200475

Checkout / Checkin Files

Checkin a file>cleartool checkin –c “Fix Bug 103” myfile.c

Checked in “myfile.c” version “/main/4”.

Cancel Checkout of a file>cleartool uncheckout myfile.c

Save private copy of “myfile.c"? [yes] no

Checkout cancelled for “myfile.c”.

Page 76: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200476

Creating new elements Add new directory to a VOB

> cleartool mkdir docCreation comments for “doc”:

New directory for documentation.Created directory element “doc”.Checked out “doc” from version “/main/0”.

Add new element to a VOB> cleartool mkelem document1.txtCreation comments for “document1.txt”:

New document.Created element “document1.txt” (type “text_file”)Checked out “document1.txt” from version “/main/0”.

Page 77: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200477

Metadata for Process Control

Labels

Attributes

Branching

Merging

Hyperlinks

Element Types

Triggers

Page 78: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200478

Labels

Declare new label type>cleartool mklbtype –c “Release2” REL2Created label type “REL2” .

List Label types declared>cleartool lstype -kind lbtype05-Sep.15:49 plkvobadm label type "CHECKEDOUT" "Predefined label type used to represent checked out versions."30-Jun.16:46 plkvobadm label type "REL2" “Release2"

Label a file>cleartool mklabel REL2 myfile.cCreated label “REL2” on “myfile.c” version “/main/4”

Page 79: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200479

Attributes Declare attribute type

>cleartool mkattype –c “Sample Attribute” Project

>cleartool mkattype –c “Sample Metric Attribute” \–vtype integer –gt 0 –le 10 -default 1 Metric_Attribute

>cleartool mkattype –c “Development stages” \-enum /”development/”,/”integration/”, /”released/” Stage

Attributes can be attached to an element, a branch, a specific versionor even hyperlinks and symbolic links and their usage can berestricted to specific branch, version by –vpbranch , -vpversionswitches

Page 80: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200480

Attributes

Attach attribute/value pair to a file/version/branch>cleartool mkattr –ver /main/3 Metric_Attribute 6 myfile.c

Created attribute “Metric_Attribute” on “myfile.c@@/main/3”

Replace existing attributes>cleartool mkattr –config hello.exe –replace qa_tested /”waiting/”

Created attribute “qa_tested” on “/project/@@/main/3”

Created attribute “qa_tested” on “/project/src/@@/main/2”

Created attribute “qa_tested” on “/project/src/myfile.c@@/main/2”

Created attribute “qa_tested” on “/project/src/myfile.h@@/main/2”

Remove attribute instance>cleartool rmattr Stage myfile.c

Page 81: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200481

Branching

Declare new branch type>cleartool mkbrtype –c “Bug Fixes” rel2_bugsCreated branch type “rel2_bugs” .

List branch types>cleartool lstype -kind brtype05-Sep.15:49 plkvobadm branch type "main"

"Predefined branch type used to represent the main branch of elements."

30-Jun.16:20 plkvobadm branch type “rel2_bugs“ "Bug Fixes"

Page 82: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200482

Branching

Branch a file>cleartool mkbranch rel2_bugs myfile.cCreation comments for “myfile.c@@/main/rel2_bugs":

Bug Fix Branch.Created branch "rel2_bugs" from “myfile.c" version

"/main/4".cleartool: Warning: Version checked out

("/main/rel2_bugs/0") is different from version selected by view before checkout ("/main/4").*

Checked out “myfile.c" from version "/main/rel2_bugs/0".

* You need to set your configuration specs to the new branch rel2_bugs

Page 83: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200483

Branching

Configuration specs could be set to view a specific branch of an element, or create this branch if it doesn’t exist when checked out.

element * CHECKEDOUT

element * …/rel2_bugfix/LATEST

element * /main/LATEST –mkbranch rel2_bugfix

Page 84: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200484

Merging

Merge Algebra base contrib 1 contrib 2 merge

result

F

A A A A

B

D

E

C

D

Q

B

Z

?

deleted

inserted

changed

deleted

C inserted

changed Z changed

changed conflict

Page 85: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200485

Merging

2

0

/main

0

1

1

/bugsBranch

3

Merge

A common merge practice

Merge from bugs branch to the main branch of the file

Page 86: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200486

Merging

>cleartool co myfile.c@@/main/LATESTCheckout comments for "myfile.c":

.

cleartool: Warning: Version checked out ("/main/3") is different from version selected by view before checkout ("/main/bugs/1").

Checked out "myfile.c" from version "/main/3".

>cleartool catcselement * CHECKEDOUT

element * /main/bugs/LATEST

element * /main/LATEST

Page 87: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200487

Merging

cleartool merge -to myfile.c -ver /main/bugs/LATEST

<<< file 1: /vobs/TNT_pfgen/pfgen/myfile.c@@/main/1>>> file 2: /vobs/TNT_pfgen/pfgen/myfile.c@@/main/bugs/1>>> file 3: myfile.c--------[after 11 file 1]----------|------[inserted 12-13 file 2]----- -| | Added in Branch bugs |---------[after 11 file 1]----------|-------[inserted 12-15 file 3]-----

-| | added version 3 |-Do you want the INSERTION made in file 2? [yes] yApplying INSERT from file 2 [lines 12-13]Do you want the INSERTION made in file 3? [no] yApplying INSERT from file 3 [lines 12-15]Moved contributor "myfile.c" to "myfile.c.contrib.1".Output of merge is in "myfile.c".Recorded merge of "myfile.c".

Page 88: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200488

Merging>cleartool describe myfile.cversion "myfile.c@@/main/CHECKEDOUT" from /main/3

(reserved) checked out 12-Jul-02.11:50:28 by username

(username.plk@plkvob) by view: username_vu

(“plkview:/dsk3/views/username_vu.vws") Element Protection: User : username : rwx Group: plk : rwx Other: : r-x element type: text_file predecessor version: /main/3 Hyperlinks: Merge <- /vobs/plk_IT_basetrain/myfile.c@@/main/bugs/1

Page 89: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200489

Merging

>cleartool checkin -nc myfile.c

cleartool: Warning: Version checked in is not selected by view.

Checked in "myfile.c" version "/main/4".

Page 90: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200490

Hyperlinks

2 1 1

23

/main

0

1 0/bugfix

/main

0

1 0/bugfix

myfile.c myfile.doc

QA_LINKQA_LINK -> /vob/project/myfile.doc

@@/main/bugfix/2

QA_LINK <- /vob/project/myfile.c @@/main/bugfix/1A hyperlink is an annotation that depicts a

relationship between two objects

Page 91: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200491

Hyperlinks

Create hyperlink type>cleartool mkhltype –c “Sample hyperlink” TESTED

Created hyperlink type “TESTED”.

Attach hyperlink instance. It can be attached to element, version or branch.>cleartool mkhlink TESTED myfile.c myfile.doc

Created hyperlink “TESTED@102@/vob/plk_IT_basetrain”.

Page 92: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200492

Hyperlinks

Search for a hyperlink

>cleartool find . –version ’hltype(TESTED)’ -print

./myfile.c@@/main/3 ./myfile.doc@@/main/1

>cleartool find . –version ’hltype(TESTED,->)’ -print ./myfile.c@@/main/3

>cleartool find . –version ’hltype(TESTED,<-)’ -print ./myfile.doc@@/main/1

Page 93: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200493

Element Types

Create new subtype of ‘text_file’ type>cleartool mkeltype –supertype text_file –c “VHDL source file” vhdl_source

Created element type “vhdl_source”.

Create new element of predefined type>cleartool mkelem –nc and2.vhdCreated element “and2.vhd” (type “vhdl_source”).Checked out “and2.vhd” from version “/main/0”

Create new element of undefined type>cleartool mkelem –eltype text_file and2.abcCreated element “and2.abc” (type “text_file”).Checked out “and2.abc” from version “/main/0”

Page 94: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200494

Element Types

Change existing element types>cleartool chtype vhdl_source and2.vhd nand2.vhd

Changed type of element “and2.vhd” to vhdl_source. Changed type of element “nand2.vhd” to vhdl_source.

Element types and file-typing rules are stored in magic files (default magic file is at /usr/atria/config/magic/default.magic)

A user can create his/her own magic file (<anyname>.magic) and point the environmental variable MAGIC_PATH to it.

Page 95: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200495

Element Types

Sample of Magic file contents :doc_file compressed_file : -name "*.[dD][oO][cC]" ;

ms_excel ms_office compressed_file : -name "*.[xX][lL][sS]" ;

csh_script script text_file : -printable & -magic 0, "#!" & -token "csh" ;

ksh_script script text_file : -printable & -magic 0, "#!" & -token "ksh" ;

pdf compressed_file : -name "*.[pP][dD][fF]" ;

Page 96: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200496

Triggers

Use triggers to control the development process

Triggers can execute before or after the specified command

— Verify conditions are met prior to execution — Prevent unauthorized individuals from executing commands

Triggers can execute after the specified command — Send notifications to concerned project members — Apply meta-data to elements if specified criteria is met

Page 97: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200497

Build Control

Build tools Additional features in clearmake Derived Objects Configuration Records Manipulating Derived Objects Parallel and Distributed Builds

Page 98: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200498

Build Tools

Clearmake:— the main tool used with Unix

Omake:— another tool used on Windows that can be

integrated with Developer's Studio as a replacement to its default compiler. clearmake exists on Windows also

Page 99: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 200499

Additional Features in clearmake

Build auditing -- a complete “bill of material” Automatic detection of source dependencies including

header file dependencies Build avoidance algorithm -- guarantees correct results

in a parallel development environment Binary sharing among developers Compatibility modes -- use clearmake with makefiles

constructed for other make variants Parallel and distributed building in a heterogeneous

environment

Page 100: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004100

Derived Objects

A derived object (DO) is any file created within a VOB by a build script

Each DO consists of a :— File name and VOB directory— Derived object identifier (DO-ID)

Hello@@24-Feb.16:40.134— Data container— Configuration record (CR) — VOB database catalog for shareable DOs

Page 101: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004101

Derived Objects

List derived objects :>cleartool lsdo –long23-Aug-02.12:14:23 username

(username.sysadmin@plkvob)

create derived object "reg_model.exe@@23-Aug.12:14.651"

size of derived object is: 488287

last access: 23-Aug-02.12:14:23

references: 1 => plkview:/net/plkview/views/username_regmodel_vu.vws

Page 102: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004102

Configuration Records

View configuration records (CR) :>cleartool catcr reg_model.exe

Target exec built by username.sysadminHost “plkview" running SunOS 5.8 (sun4u)Reference Time 23-Aug-02.12:11:12, this audit started 23-Aug-

02.12:13:38View was plkview:/net/plkview/views/username_regmodel_vu.vwsInitial working directory was /vobs/plk_IT_basetrain/regmodel/ss6----------------------------MVFS objects:----------------------------/vobs/plk_IT_basetrain/regmodel/src/glue/Makefile@@/main/1 <06-Jun-

02.10:08:48>/vobs/plk_IT_basetrain/regmodel/src/glue/overrides.mk@@/main/1 <02-Jul-

99.01:35:08>/vobs/plk_IT_basetrain/regmodel/src/glue/overrides.ss6.mk@@/main/1 <02-

Aug-00.00:25:23>…

Page 103: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004103

Configuration Records

----------------------------

Variables and Options:

----------------------------

GMAKE_PARALLEL=

MAKE=/opt/rational/clearcase/bin/clearmake

MAKEFLAGS=

PATH_MGC=/usr/devmgc

----------------------------

Build Script:

----------------------------

/opt/rational/clearcase/bin/clearmake -w exec ;

/usr/devmgc/lib/mgcms/do_exports glue/exports.exec exports

----------------------------

Page 104: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004104

Configuration Records

Comparing config records>cleartool diffcr regmodel.exe regmodel.exe@@31-Oct.07:25.304

Differences detected:— Versions of MVFS objects used as sources— Objects produced during the build— Versions of non-MVFS objects that appeared as makefile

dependencies— The number of times an object was referenced during the

build, and the first target in which that object was referenced— Build options— The build script executed

Page 105: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004105

Manipulating Derived Objects

Unshared derived objects (produced in express build) can be promoted to the VOB database to be used by other views via Winkin process, e.g.>cleartool winkin DO-pname

To preserve configuration records (CR) of the derived object (DO) during checking in the DO, you have to checkin to its place in the VOB. You can use –from switch if the DO is created in another directory, e.g.>cleartool checkin –c “Beta 2 Build” –from ./hello ../bin/hello

Page 106: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004106

Manipulating Derived Objects

view_scrubber is used to remove derived objects data containers as long as they are checked in the VOB. It can be used also to convert DOs to shareable or promote these DOs. It can be found at /opt/rational/clearcase/etc/view_scrubber

Page 107: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004107

Using ClearCase On Windows

Page 108: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004108

Requirements and Settings

•User Environment variables (not SYSTEM variables):

•CCASE_BLD_UMASK 002

•CLEARCASE_PRIMARY_GROUP plk

(User’s Primary Group in Active Directory)

- Control Panel ClearCase Options, choose the Domain MGC

- You may need to restart your PC after ClearCase installation to confirm Clearcase services are up using MGC\clearcase_albd Account:

- Control Panel Administrative Tools Services Atria Location Broker: This service should be Automatically Up with “Log On As” MGC\clearcase_albd

Page 109: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004109

How To share The View LocationThe View Location on the PC should be shared (Full Control) for both:

1- User’s MGC Account

2- MGC\clearcase_albd  Account From “My Computer”, On the Partition where you have the

largest free space (Ex: E ), Create a new folder: cc_views Right Click on the folder, Choose “Sharing And Security..”,

Choose “Share This Folder”, Share Name: cc_views, Click on “Permissions” button, Click on “Add” button, Type your login name, check it and add it, then type “clearcase_albd”, check it and add it.

For both accounts choose “Full Control” in the lower part of the share permissions tab, then click OK to accept the settings.

Page 110: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004110

ClearCase Program menu

Page 111: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004111

ClearCase Home Base User Interface

Page 112: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004112

ClearCase Properties

Page 113: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004113

Make Sure CC Is Running

Page 114: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004114

Stopping CC

If ClearCase If ClearCase Cannot be Cannot be stopped/restarted, stopped/restarted, you have to you have to restart your PC.restart your PC.

Page 115: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004115

ClearCase Properties

Page 116: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004116

Create View

Page 117: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004117

Create View, Cont.

Page 118: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004118

Create Dynamic View

Page 119: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004119

Create Dynamic View, Cont.

The Mapped Drive The Mapped Drive Letter could be any Letter could be any free mapping Letter. free mapping Letter. Ex: Z, Y, X, …. Ex: Z, Y, X, …. Check Network Check Network Drives in “My Drives in “My Computer” Or Computer” Or “Windows Explorer”“Windows Explorer”

loginname_loginname_vuvu

Page 120: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004120

Create Dynamic View, Cont.Advanced Options

\\machine\\\machine\cc_viewscc_views\\MGCMGC\loginname\loginname_vu.vws\loginname\loginname_vu.vws

plk_ntplk_nt

Page 121: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004121

Create Dynamic View, Cont.

loginname_loginname_vuvu

Page 122: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004122

Create Dynamic View, Cont.

loginname_loginname_vuvu

Page 123: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004123

Create Snapshot View

Page 124: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004124

Create Snapshot View, Cont.

E:\E:\cc_viewscc_views\\MGCMGC\loginname\loginname_snap_vu\loginname\loginname_snap_vu

Page 125: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004125

Create Snapshot View, Cont.Advanced Options

E:\E:\cc_viewscc_views\\MGCMGC\loginname\loginname_snap_vu.vws\loginname\loginname_snap_vu.vws

loginname_snap_vuloginname_snap_vu

Page 126: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004126

Create Snapshot View, Cont.

E:\E:\cc_viewscc_views\\MGCMGC\loginname\loginname_snap_vu\loginname\loginname_snap_vu

Page 127: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004127

Create Snapshot View, Cont.Select VOBs/Elements To Load

Page 128: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004128

Create Snapshot View, Cont.

Page 129: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004129

Create Snapshot View, Cont.

loginname_snap_vuloginname_snap_vu

Page 130: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004130

Updating Snapshot View

Page 131: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004131

Remove View

Page 132: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004132

Remove View, Cont.

Page 133: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004133

Remove View, Cont.

Page 134: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004134

Remove View, Cont.

test_tmp_vutest_tmp_vu

Page 135: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004135

ClearCase Doctor

Page 136: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004136

Context Sensitive Menus

Page 137: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004137

Mounting VOBs

Page 138: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004138

Compare Versions

Comparing with Comparing with Previous Version is Previous Version is not always successful. not always successful. It depends on the file It depends on the file type. Ex: It Can’t be type. Ex: It Can’t be done with MS done with MS Project .mpp files and Project .mpp files and certain MS Word certain MS Word versions.versions.

Page 139: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004139

Element Properties

Page 140: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004140

Version Tree Browser

Page 141: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004141

Version Tree Browser, Cont.

Page 142: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004142

UCM On UNIX

Page 143: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Using Unified Change Management ClearCase

General concept & UNIX

Page 144: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004144

Unified Change Management

Pros and Cons UCM Workflow Roles and Responsibilities UCM Terminology Setting Up Working Areas Finding and Setting Activities Working on Activities Delivering Activities Rebasing your Work Area Sample GUI scenario

Page 145: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004145

Pros and Cons

Pros— Provides an out of box solution enabling groups to work on product

development, not customizations.— Automatically manages artifacts and work in progress.

Config specs are managed by the software, not the developer. Artifacts are tracked by "activities", allowing the user to more readily identify

the work done for specific tasks. Activities can be more easily prioritized because of the way they are identified. Work loads and critical paths can be identified more easily too. Generic reporting capabilities are included in the system.

— Work is done in isolation to not impact others. Users choose when to make changes available to others.

— Work on specified tasks can be tracked easily during the entire software lifecycle.

— Should be good for teams without well defined software development processes.

Page 146: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004146

Pros and Cons

Cons— Can be customized, but provides a fairly rigid methodology that

must be followed.— Though it is based on many years of development and many

customers' usage models, the UCM features are recent enhancements to ClearCase (1999).

— Sharing data between projects is constrained, administrative guidelines must be followed. Components can be controlled by only ONE PVOB.

Page 147: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004147

UCM Workflow

Page 148: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004148

UCM Workflow

- Join UCM Project.

- Create 2 work areas :

- Private area for working in isolation in activities

- Shared area for testing activities delivered

Page 149: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004149

UCM Workflow

- Use cleartool lsactivity to list activities in your work area.

- Setting your view to an activity instructs ClearCase to assign any versions of source files you create to the activity’s change set. You must set your view to an activity before you can work on an activity.

Page 150: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004150

UCM Workflow

- Checkout files to be writable for developer.

- View / Modify Metadata to describe changes.

- Checkin changes.

- Indicate progress either by ClearQuest or by specific schema.

Page 151: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004151

UCM Workflow

- Prepare work areas if they are older than current integration.

- Start deliver operation

- Merge changes between private work area and shared integration area.

- Build and Test integration.

- Finish delivery and ClearCase will check in modifications.

Page 152: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004152

UCM Workflow

- Integrator organizes delivered activities into baselines. When a baseline reaches stable level after testing, your integrator designates it as a recommended baseline.

- To work with the set of versions in the recommended baseline, you rebase your development work area. You will need to merge this new baseline with your private area, test and complete rebase operation.

Page 153: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004153

Roles and Responsibilities

Project manager — Allocates components and activities for the project — Determines initial milestones (baselines) — Specifies the project's policies and tasks

Architect — Translates project architecture into directory structure

Administrator — Creates and maintains the infrastructure

Page 154: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004154

Roles and Responsibilities

Developer — Creates and modifies project activities — Builds and tests changes — Delivers changes to the integration area — Manages personal work areas

Integrator — Integrates changes from developers into the project's integration

work space — Builds and tests changes — Creates new baselines

Page 155: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004155

UCM Terminology

Elements— Files and directories put under version control of Clearcase.

Components— Elements are organized as components. Usually, components can be built into functional units

of software.

Baselines— To keep track of different

configurations of versions, your project manager or integrator creates a base-line, which records one version of each element in a component. In effect, a base-line is a version of a component.

Page 156: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004156

UCM Terminology

Activities— To create a version in a ClearCase

UCM project, you must first assign it to an activity. An activity is a ClearCase object that identifies the versions created to complete a task.

Streams— A stream is a long-lived ClearCase

object. It is a member of a single UCM project and is a mechanism for creating and recording config-urations. A stream identifies the exact set of versions currentlyavailable for you to view, modify, or build.

Page 157: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004157

UCM Terminology

Integration Stream

Development Streams

Page 158: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004158

Setting Up Working Areas

Adjust your UMASK— Set your umask to appropriate permission scheme.— Another build umask for derived objects is set by setting

environmental variable CCASE_BLD_UMASK

Join UCM project— Run Join Project Wizard using the command

> clearprojexp

Verify stream names— Development stream: By default the name given to it is

your-user-name_project-name— Integration stream: Project Manager creates the integration stream

during project creation. This stream is the default target to which you deliver your work and from which you update your work area.

Page 159: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004159

Setting Up Working Areas

Set up views— The wizards sets the following naming defaults :

Development view : the view name is the same as the stream name. Integration view : the view name is

your-user-name_integration-stream-name

Access your development view— After creating your development view, the Join Project Wizard

offers to open your development view in a shell or File Browser (xclearcase), a GUI from which you can browse files and directories.

— To access your development view using command line, you will need to set your dynamic view and mount the VOB which contains your project :

> cleartool setview your_view-tag > cleartool mount vob-tag

Page 160: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004160

Finding and Setting Activities

Finding Activities— Find activities by Project Explorer GUI (using the command clearprojexp)

— Find activities with ClearCase Dialogs. When using xclearcase GUI, during checkout/checkin commands you get a dialog box from which you can find activities available to select among them the activity you currently work at.

— Find activities by command line > cleartool lsactivity

For example:> cleartool setview your_view_tag> cd vob_tag> cleartool lsactivity –cview05-Aug.09:14:17 set_up_Java project pat “set up Java project”06-Aug.14:17:19 change_copyright_notice chris “change copyright

notice”

Page 161: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004161

Finding and Setting Activities

Creating Activities— Using xclearcase GUI when performing checkin/checkout, if the activity

still not created you can use new button in Activity dialog to create a new activity.

— Using command line :> cleartool mkactivityFor example:

>cleartool mkactivity –nset –headline “Your chosen headline”

Created activity with automatically generated name? [yes]Created activity “Your chosen headline”

Where,

-nset : prevents ClearCase from setting your view to the newly created activity.

Page 162: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004162

Finding and Setting Activities

Setting your view to an activity— Using xclearcase GUI when performing checkin/checkout, select

from Activity box the activity you want to work on.

— Using command line:

> cleartool setactivity

For Example :

> cleartool setactivity Your_activity

Unsetting your view from an activity— Using command line:

>cleartool setactivity –none

Page 163: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004163

Working on Activities

Checking Out Elements— To modify files and directories under source control, you must

check them out. Checking out does not add versions to the activity that is currently set in the view. (Checking in creates new versions, which Rational ClearCase adds to the activity’s change set.)

— Use command line to checkout >cleartool checkout –query list-of-elements

Checkout important switches :-query : Detects potential problems in the checkout process caused by inappropriate config specs and prompts for action.-nc : Prevents ClearCase from prompting for a comment.-cq : Applies prompted comment to all elements in the list.

Page 164: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004164

Working on Activities

Working with Checkouts— To view an element history

> cleartool lshistory –graphical element_pathname

— To view an element version tree> cleartool lsvtree –graphical element_pathname

— To compare with predecessor version> cleartool diff –graphical –predecessor element_pathname

— To compare with different versions> cleartool diff –graphical element_pathname element_pathname@@version

— To track checked out versions by myself in current view in all vobs> cleartool lscheckout –cview –me –avobs

Page 165: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004165

Working on Activities

Working with Checkouts— To view all activities’ change sets of current view.

> cleartool lsactivity –long –cview

— To view current activity’s change set> cleartool lsactivity –long –cactactivity SAMPL05111105-Aug-01.09:14:17 by Pat (pat.user@bread)"Created for the cropcircle_1.4 project on 09/17/00 13:25:24."owner: patgroup: userstream: pat_1.4_CropCircletitle: changing_copyright_stringschange set versions:/guivob/prog.c@@/main/stream990805.090736/5/guivob/spices.c@@/main/stream990805.090736/2/guivob/onions.c@@/main/stream990805.090736/9/guivob/tomatoes.c@@/main/stream990805.090736/1/guivob/flour.c@@/main/stream990805.090736/3

Page 166: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004166

Working on Activities

Canceling Checkouts— If you check out a file but don’t want to check in your changes or want to

start with a fresh copy, you can cancel the checkout > cleartool uncheckout element_pathname

Checkout important switches :-keep : Saves modifications in view private file.-rm : Doesn’t save modifications.

Checking In Elements> cleartool checkin -cact element_pathname

Checkout important switches :-cact : Checkin versions checked out for the activity currently

set in your view.-nc : Prevents ClearCase from prompting for a comment.-cq : Applies prompted comment to all elements in the list.

Page 167: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004167

Delivering Activities

Deliver Operation— From your development view type

> cleartool deliver –graphical

— Select the activity you want to deliver— Select the stream to deliver the

activity to (if not default target)

Deliver dependencies (Example)— You can deliver Activity B without delivering Activity C— To deliver Activity C, which contains

version 6, you must also deliver Activity B, which contains the

versions between 6 and the most recent delivery of prog.c

Page 168: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004168

Delivering Activities

Merge Versions— If your project uses Rational ClearCase MultiSite to share source

data with developers in other geographical locations, and if the project’s streams are mastered at a different site, you do not merge versions.

— After selecting activities, click OK in the Deliver Preview dialog box to start merging versions in your development view with versions in the integration view.

— As it merges files and directories, ClearCase displays its progress in a ClearCase UCM Deliver window. For each new version delivered to the integration view, ClearCase merges all non-conflicting differences. To see progress of the merge, click Details and an expansion box lists the versions in the merge

Page 169: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004169

Delivering Activities

Handling a Binary File in a Deliver Operation

— If you have a binary file in any of your activities when you perform the deliver operation, and your organization does not have a type manager for that file type, ClearCase generates an error when it encounters the binary file during the delivery. The error occurs because there is no type manager that can merge the version of the file in your development stream with the version of the file in the integration stream

— Your project manager can overcome this problem by creating a special element type for the binary file type and associating that element type with the binary file in the VOB. This special element type can tell the ClearCase system not to attempt merging the file

Page 170: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004170

Delivering Activities

Undoing a Deliver Operation— Using the command line:

>cleartool deliver –cancel

— Or by clicking cancel in merge manager dialog box.

Completing a Deliver Operation— Open the Deliver Progress dialog box from your development view, use

command line:

> cleartool deliver –complete

— Completing a delivery of an activity means checking in merge results to the target stream and changing the state of the operation to Complete.

Page 171: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004171

Delivering Activities

Deliver to non-mastered stream in MultiSite projects— The deliver operation determines whether your development and

target streams are mastered at different replicas. If they are mastered at different replicas, a remote deliver operation is put into effect. ClearCase changes mastership of the development stream object to match that of the target stream object, and it notifies you that it has assigned the development stream the posted status.

— When your development stream has the posted status, notify the project integrator at the site that masters the target stream’s replica. The project integrator can then find posted deliver operations and either continue the operation or cancel it to return the development stream to its previous state. Note that, after you post your work, only someone at the master site can cancel or complete the operation.

Page 172: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004172

Delivering Activities

Deliver to non-mastered stream in MultiSite projects— You can create activities and perform checkins and checkouts for

your development stream while the remote deliver is in process. However, you cannot add, remove, or create baselines; add or remove components; or rebase the development stream. The delivery completes when the posted deliver operation is merged with the target stream.

Page 173: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004173

Rebasing Your Work Area

Rebase Operation— From your development view type:

> cleartool rebase –graphical

— Select the Baseline from the Rebase Dialog Box— Select the view you want to Rebase.

Stop a Rebase Operation— By clicking cancel in Rebase Dialog Box

Resume a Rebase Operation— Use the command line:

> cleartool rebase –resume –graphical

Page 174: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004174

Rebasing Your Work Area

Merge Versions in a Rebase Operation— As it does during the deliver operation, ClearCase merges all nonconflicting

differences. If versions in the baseline contain changes that conflict with the corresponding versions in your development work area, ClearCase prompts you to start Diff Merge so that you can resolve the conflicts.

Cancelling a Rebase Operation— Using the command line:

> cleartool rebase –cancel

— Or by clicking cancel in merge manager dialog box.

Completing a Rebase Operation— Open the Rebase Progress dialog box from your development view, use command line:

> cleartool rebase –complete

— Completing a rebase of an activity means checking in merge results to the target stream and changing the state of the operation to Complete.

Page 175: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004175

GUI Sample Scenario

Invoke clearprojexp Display project streams Display development stream activities Display integration stream PVOB properties Project properties Project policies Join project wizard Set streams Set development view Set integration view Join completion summary

Page 176: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004176

GUI Sample Scenario

Invoke xclearcase and select view Checkout an element to modify Attach checkout to an activity Deliver activity from development stream Select activity and target stream Complete delivery process when done Create/Modify Baseline Baseline details Select Baseline Select merging view

Page 177: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004177

Invoke clearprojexp

Page 178: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004178

Display project streams

Page 179: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004179

Display development stream activities

Page 180: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004180

Display integration stream

Page 181: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004181

PVOB properties

Page 182: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004182

Project properties

Page 183: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004183

Project Policies

Page 184: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004184

Join project wizard

Page 185: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004185

Set streams

Page 186: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004186

Set development view

Page 187: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004187

Set integration view

Page 188: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004188

Join completion summary

Page 189: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004189

Invoke xclearcase and select view

Page 190: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004190

Checkout an element to modify

Page 191: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004191

Attach checkout to an activity

Page 192: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004192

Deliver activity from development stream

Page 193: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004193

Select activity and target stream

Page 194: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004194

Complete delivery process when done

Page 195: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004195

Create/Modify Baseline

Page 196: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004196

Baseline details

Page 197: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004197

Rebase development stream

Page 198: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004198

Select Baseline

Page 199: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004199

Select merging view

Page 200: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004200

Reference

This training material is based on the web training available at the URL:

http://devnet.wv.mentorg.com/env/confman/ClearCase/training/cc_user/fbody.htmlhttp://devnet.wv.mentorg.com/env/confman/ClearCase/training/cc_user/fbody.html

Page 201: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004201

Using ClearCase UCM On Windows

Page 202: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004202

UCM GUI Sample On Windows

Invoke clearprojexp Display project streams Display development stream

activities Display integration stream Project Actions Project Policies Join project wizard Set streams Set Views Choose Components Join completion summary Snapshot View Update

Checkout an element to modify Attach checkout to an activity Check In Element & Record In

Activity Deliver activity from development

stream Select activity and target stream Complete delivery process when

done Create/Modify Baseline Baseline details Rebase Development Stream Select Baseline & Merging View Complete the Rebase Operation

Page 203: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004203

Invoke clearprojexpStartProgramsRational SoftwareRational ClearCaseProject Explorer

Page 204: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004204

Display project streams

Page 205: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004205

Display development stream activities

Page 206: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004206

Display integration stream

Page 207: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004207

Project Actions

Page 208: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004208

Project Policies

Page 209: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004209

Join project wizard

Page 210: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004210

Set streams

Page 211: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004211

Set Types Of Views

Page 212: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004212

Set Development view

Page 213: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004213

Set integration view

Page 214: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004214

Choose Components

Page 215: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004215

Join completion summary

Page 216: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004216

Snapshot Views Update

Page 217: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004217

Checkout an element to modify

Page 218: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004218

Attach checkout to an activityThen Modify Element

Page 219: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004219

Check In Element & Record in Activity

Page 220: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004220

Deliver activity from development streamTo Default Integration Stream

Page 221: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004221

Select activity and target stream

Page 222: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004222

Complete delivery process when done

Page 223: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004223

Create/Modify Baseline

Page 224: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004224

Baseline details

Page 225: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004225

Rebase development stream

Page 226: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004226

Select Baseline & Merging View

Page 227: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004227

Complete The Rebase Operation

Page 228: ClearCase Training January 2005 Cairo Clearcase Team Cairo, Egypt Amr Elhusseiny IT Manager

Cairo IT Team, ClearCase training, July 2004228

Reference

This training material is based on the web training available at the URL:

http://devnet.wv.mentorg.com/env/confman/ClearCase/training/cc_user/fbody.htmlhttp://devnet.wv.mentorg.com/env/confman/ClearCase/training/cc_user/fbody.html


Top Related