Merging from a project to a non-UCM branch

You may be in a situation in which part of the development team works in a UCM project, and the rest of the team works in base VersionVault. If you are a longtime HCL VersionVault user, you may decide to use UCM initially on a small part of your system. This approach would allow you to migrate from base VersionVault to UCM gradually, rather than all at once.

In this case, you need to merge work periodically from the integration stream of the project to the branch that serves as the integration branch for the system. To do so, use a script similar to the one shown here, which uses base VersionVault functionality to merge changes.

# Sample Perl script for delivering contents of one UCM project to 
# a nonUCM project. Run this script while set to a view that sees the
# destination branch.
#
# Usage: Perl <this-script> <project-name> <project-vob>

use strict;

my $mergeopts = '–print';
my $project = shift @ARGV;
my $pvob = shift @ARGV;
my $bl;

chdir ($pvob) or die("can’t cd to project VOB '$pvob'");

print("######## Getting recommended baselines for project
'$project'\n");
my @recbls = split(' ', ‘cleartool lsproject –fmt "%[rec_bls]p"
$project‘);

foreach $bl (@recbls) {

   my $comp = ‘cleartool lsbl –fmt ";
   my $vob = ‘cleartool lscomp –fmt ";

   print("######## Merging changes from baseline '$bl' of $vob\n");

   my $st = system("cleartool findmerge $vob –fver $bl $mergeopts");
   $st == 0 or die("findmerge error");
}

exit 0;

The script finds the recommended baselines for the integration stream from which you are merging. It then uses the cleartool findmerge command to find differences between the versions represented by those recommended baselines and the latest versions in the target branch. For details, see the findmerge reference page.

You can add to this script error handling and other logic appropriate for your site.