Tuesday, January 8, 2008

The ClearCase Eraser -- Activity

In ClearCase, it is not recommended to delete anything from the source control. And UCM makes it extremely hard to remove an UCM object once it is been modified.

The following steps guide you through to remove an activity with change set.

First get the list of versions in the change set.
$ cleartool lsact -l DOMDAM_base_class
activity "DOMDAM_base_class"
04-Dec-07.11:00:59 by Cheung (dc81.Domain Users@CBAD1-XCILPE)
owner: hz18
group: unknown
stream: CBFE14.5_base_hz18@/vobs/CBFEProjects
title: CBFE14.5: DOMDAM base class
change set versions:
/vobs/MidTier/Srv/src/com/cccc/evo/dom@@/main/Mainline_i/CBFE14.5_base_hz18/2
/vobs/MidTier/Srv/src/com/cccc/evo/dom@@/main/Mainline_i/CBFE14.5_base_hz18/2/AbstractQuery.java/main/CBFE14.5_base_hz18/1
/vobs/MidTier/Srv/src/com/cccc/evo/dom@@/main/Mainline_i/CBFE14.5_base_hz18/1
/vobs/MidTier/Srv/src/com/cccc/evo/dom@@/main/Mainline_i/CBFE14.5_base_hz18/1/Query.java/main/CBFE14.5_base_hz18/1
/vobs/MidTier/Srv/src/com/cccc/evo/dal/cache/CacheManagerImpl.java@@/main/CBFE14.5_base_hz18/2
/vobs/MidTier/Srv/src/com/cccc/evo/dal/cache/CacheManagerImpl.java@@/main/CBFE14.5_base_hz18/1
/vobs/CBFE-lib/non-cccc@@/main/Mainline_i/CBFE14.5_base_hz18/1/xmlbeans-2.2.0/main/CBFE14.5_base_hz18/1
/vobs/CBFE-lib/non-cccc@@/main/Mainline_i/CBFE14.5_base_hz18/1

For each version in the change set, do the following command with the options to remove it with its reference.
$ cleartool rmver -xbranch -xlabel -xattr -xhlink /vobs/MidTier/BaseUtil/src/.project@@/main/Mainline_i/CBFE14.5_i/CBFE14.5_base_hz18/1

During the rever operation, some elements may be moved t lost+found if it is no longer being referenced.
cleartool: Warning: Object "xmlbeans-2.2.0" no longer referenced.
cleartool: Warning: Moving object to vob lost+found directory as "xmlbeans-2.2.0.e650a507ad794c789fed652fcf875fcb".

After all the version removed, run lsact again. There may be new items listed in the change set.
$ cleartool lsact -l DOMDAM_base_class
activity "DOMDAM_base_class"
04-Dec-07.11:00:59 by Cheung (dc81.Domain Users@CBAD1-XCILPE)
owner: hz18
group: unknown
stream: CBFE14.5_base_hz18@/vobs/CBFEProjects
title: CBFE14.5: DOMDAM base class
change set versions:
/vobs/CBFE-lib/lost+found/xmlbeans-2.2.0.e650a507ad794c789fed652fcf875fcb@@/main/CBFE14.5_base_hz18/1

repeat the rmver and lsact until the change set is empty.

The activity can be removed now.
$ cleartool rmact -force "DOMDAM_base_class"
Removed activity "DOMDAM_base_class".

No comments: