A Better Solution, Inc. - IBM Rational ClearCase Triggers

"Clearcase, Rational, clearCase consulting, ClearCase triggers, Jazz tools consultant, ABS, training, GSA, Rational, IBM, GSA, BM Rational Tools consultant, Clearquest, ClearCase training, CM, scm, ClearCase help, consulting, trainer, training, ClearCase guru, configuration management" "ClearCase triggers, RTC, Rational Team Concert, clearcase, CLEARCASE resume, trainer, consultant, clearcase, BM Rational Tools consultant, ClearCase training, GSA contract holder, Rational, IBM, CM, scm, ClearQuest Consulting, ClearCase help, consulting, trainer, training, ClearCase guru, configuration management" "triggers, ClearCase training, RTC, Requisite Pro, JAZZ, ABS, GSA Schedule holder, Rational, IBM, ClearCase training, CM, scm, ClearCase help, consulting, ClearQuest, BM Rational Tools consultant, trainer, training, ClearCase guru, configuration management"
RM_EMPTY_BRANCH.sh   Print this page...
..

RM_EMPTY_BRANCH.sh

When cleartool uncheckout, rmbranch or rmver are performed remove the parent branch if the parent branch has no checkouts, sub-branches or labeled versions associated with it IFF (IF AND ONLY IF) the uncheckout file is the 0th element or removing the branch causes the parent branch to also be "empty"


Author:A Better Solution, Inc.
Email :support@abs-consulting.com
URL :https://abs-consulting.com
Date :September 17, 1996

This trigger script is expected to be called from the post-uncheckout, post-rmbranch and post-rmver trigger like so (or similar):

cleartool mktrtype -ele -all -post uncheckout,rmbranch,rmver 
 -c "Automatically remove empty branches." 
 -exec "{path}/RM_EMPTY_BRANCH.sh" REMOVE_EMPTY_BRANCH

Shortcut using...If using ClearTrigger...

If using ClearTrigger, you don't need to write ANY trigger code... Just turn on functionality bit (0) from the list of 25 Functionality Bits in the configuration file.

Read more on Policy without Triggers using ClearTrigger.