进行项目间交付时运行的最佳命令是什么?我喜欢找到什么合并和findmerge似乎不是很容易使用,所以我想知道还有什么可用。
答案 0 :(得分:1)
您可以尝试cleartool deliver
man page:
预览交付操作:
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 ... ]
确保目标项目的交付政策授权交付: 请参阅“How to deliver a baseline from one project to another project in UCM?”。
This thread实际上引用了解析cleartool deliver -preview
输出的perl脚本
这是一个摘录(虽然不是完整的脚本)
$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";
}
如果您只想查看相关活动,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");
}