1

What is the best command to run when doing interproject deliveries? I like to find what merges and findmerge does not seem very easy to use so I wonder what else is available.

1201ProgramAlarm
  • 32,384
  • 7
  • 42
  • 56
Go Bucks
  • 151
  • 6

1 Answers1

1

You can try, from the cleartool deliver man page:

Preview a deliver operation:

deliver –pre/view [ –s/hort | –l/ong ] [ –str/eam stream-selector ]
    [ –to integration-view-tag] [ –tar/get stream-selector ]
    [ –cac/t | –act/ivities activity-selector ...
    | –bas/elines baseline-selector ... ]

Make sure the deliver policy of the destination project authorize inter-delivers though: See "How to deliver a baseline from one project to another project in UCM?".


This thread actually references a perl script parsing the output of a cleartool deliver -preview.
Here is an extract (not the full script though)

$deliver = 0;
$delmsg = "";
$sendmail = 0;
$mailprio = "";
$cmd = "cleartool deliver -preview -stream $stream";
print ("CMD ==> $cmd\n");
system ("echo $cmd >>$logfile");
$ct_out = `$cmd 2>&1 | $tee -a $logfile`;
print ("$ct_out\n\n");
if ($ct_out =~ /Changes will be POSTED/) {
    $deliver = 1;
    $sendmail = 1;
    $delmsg = "Changes to be delivered";
    print ("$delmsg\n");
    system ("echo $delmsg >>$logfile");
    $cmd = "cleartool deliver -force -stream $stream";
    print ("CMD ==> $cmd\n");
    system ("echo $cmd >>$logfile");
    system ("$cmd 2>&1 | $tee -a $logfile");
} elsif ($ct_out =~ /Deliver operation already in progress/) {
    $deliver = 0;
    $delmsg = "DELIVERY ALREADY IN PROGRESS";
    print ("$delmsg\n");
    $sendmail = 1;
} elsif ($ct_out =~ /No activities to deliver/) {
    $deliver = 0;
    $delmsg = "No activities to deliver";
    print ("$delmsg\n");
} elsif ($ct_out =~ /There are checkouts in activities/) {
    $deliver = 0;
    $delmsg = "UNABLE TO DELIVER DUE TO CHECKOUTS";
    print ("$delmsg\n");
    $sendmail = 1;
    $mailprio = "-priority 1";
} elsif ($ct_out =~ /Unable to start a deliver operation while a rebase operation is in progress/) {
    $deliver = 0;
    $delmsg = "UNABLE TO DELIVER DUE TO REBASE IN PROGRESS";
    print ("$delmsg\n");
    $sendmail = 1;
    $mailprio = "-priority 1";
} else { 
    $deliver = 0;
    $delmsg = "FAILED TO DETERMINE STATUS";
    $toaddr = $toaddr2;
    print ("$delmsg\n");
    $sendmail = 1;
    $mailprio = "-priority 1";
}

If you only want to see the dependent activities, this thread proposes:

#!/usr/bin/perl -w
use strict;

my $streamSelector = 'stream@pvob'; # here you should specify the actual stream selector

#    HASH structure
#    activity-to-deliver => http://activity-depend-on, ...

my %dependency;

#    Get all new activities that can be delivered

my $cmd = "cleartool deliver -preview -stream $streamSelector";
open(ACTIVITIES, "$cmd|") or die("Error: $!\n");
while (<ACTIVITIES>)
{
  chomp;
  if (m/^\s+activity:(^\s+)\s+/)
  {
    $dependency{$1} = [];
  }
}
close(ACTIVITIES);

#    Get dependency of all the activities

foreach my $activity (sort(keys(%dependency)))
{
  $cmd = "cleartool deliver -preview -stream $streamSelector -activities $activity";

  open(DELIVER, "$cmd 2>&1 |") or die("Error: $!\n");
  while (<DELIVER>)
  {
    chomp;
    if (m/^cleartool: Error: Activity \"(+)\" must be added to activity list\.$/)
    {
      push(@{$dependency{$activity}}, $1);
    }
  }
  close(DELIVER);
}

#    Output result

foreach (sort(keys(%dependency)))
{
  print("$_\n");
  foreach (sort(@{$dependency{$_}}))
  {
    print("\t$_\n");
  }
  print("\n");
}
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250