1

进行项目间交付时运行的最佳命令是什么?我喜欢查找合并的内容,而 findmerge 似乎不太容易使用,所以我想知道还有什么可用的。

4

1 回答 1

1

您可以从cleartool deliver手册页尝试:

预览交付操作:

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 ... ]

确保目标项目的交付策略授权相互交付:请参阅“如何在 UCM 中将基线从一个项目交付到另一个项目? ”。


这个线程实际上引用了一个解析输出的 perl 脚本cleartool deliver -preview
这是一个摘录(虽然不是完整的脚本)

$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";
}

如果您只想查看相关活动,该线程建议

#!/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");
}
于 2012-04-24T20:11:39.190 回答