Workaround: Create a lock-free Rational ClearCase synchronization for UCM streams by running custom scripts
Summary
The ClearCase Synchronizer locks a UCM stream or a branch type during the synchronization, and developers are unable to check out or check in files during the time. This is bothersome, especially when you have many files to synchronize, and also when you set up a synchronized stream, because the initial synchronization can take additional time. This workaround article provides a way to set up UCM-stream synchronization without locking the UCM stream.
You create a dedicated child stream for the synchronization, run a rebase by a custom script before the synchronization, and then run a deliver by a custom script after the synchronization. Additionally, you can set up an e-mail notification if there are unresolved merge conflicts during rebase or deliver.
More Information
Here is a simple example for setting up the dedicated synchronization stream. The dedicated synchronization stream “Int1_Sync_stream” is created based on an integration stream “Int1” (view “New_int1_view” is attached to this stream). The preOp_rebase.pl script rebases the synchronization stream with the recommended baselines on the integration stream. The PostOp_deliver.pl script delivers the changes on the synchronization stream to the UCM integration stream. To set it up, open the Properties dialog of your synchronized stream, select Jazz Provider Properties from the left navigation, and provide your script’s path to PRE_SYNC_OPERATION_PATH and POST_SYNC_OPERATION_PATH. In this example, “ccPerl C:syncOpspreOp_rebase.pl” and “ccPerl C:syncOpspreOp_rebase.pl” are provided for before and after synchronization, respectively. After you set these values, click OK, and the next synchronization executes your scripts.
Setup the synchronized stream to avoid the ClearCase stream locking
Make the following changes:
- Configure running custom scripts before and after the synchronization.
- To send email notify when there is a failed synchronization (for example, the synchronization does not start because there is a merge conflict when rebasing), open the Build Definition page of the build, and edit the email notification criteria.
Here is the sample script for preOp_rebase.pl:
print "Start rebasing stream...n"; my $retval = system ("cleartool rebase -rec -abort -comp -view " . $ENV{'CTPROVIDER_VIEW_TAG'}); if ($retval) { print "CCSync: rebase failed with exit code:${retval}n"; } else { print "CCSync: rebase completed successfully!n"; } exit $retval;
Here is the sample script for postOp_deliver.pl:
die "Cannot proceed post-sync operation as sync. failedn" if ($ENV{'SYNC_OPERATION_STATUS'} ne 'OK'); # deliver to CC int stream # specify the name of an integration view my $viewTag = NEW_int1_view; my $stream = $ENV{'CTPROVIDER_OTHER_STREAM_LOCATION'}; $stream =~ s/.*|//; my $deliverCmd = "cleartool deliver -abort -comp -f -stream ${stream} -to ${viewTag}"; print "Start delivering stream : ${deliverCmd}n"; my $retval = system ($deliverCmd); if ($retval) { print "CCSync: deliver failed with exit code:${retval}n"; exit $retval; } else { print "CCSync: deliver completed successfully!n"; }
Related Information
- Running custom scripts before and after synchronization: The Rational solution for Collaborative Lifecycle Management Information Center.
Copyright © 2013 IBM Corporation