如何知道谁推荐了ClearCase基线?

时间:2015-03-10 19:48:38

标签: clearcase clearcase-ucm

有人在我的信息流中推荐了一个基线。我怎么知道怎么推荐它?我只能看到是谁创建了它但没有得到任何推荐它的信息。是否有任何特定的命令来查看基线/流/视图等的历史记录?

1 个答案:

答案 0 :(得分:1)

我不认为会记录元数据。

您可以查看policies attached to the UCM project though

POLICY_CHSTREAM_UNRESTRICTED

如果设置,则表示只有UCM项目的所有者才能更改流上的建议基线。


否则,如下所示,您需要通过触发器捕获并记录该事件。
在ClearCase 7.x区域(可能已经改变了CC8),这是通过chstream上的操作前触发器完成的,但它必须处理两种交互:

例如参见this thread

  

recommend_bls触发,提前检查chstream是否不适合推荐基线:

if ($ENV{CLEARCASE_CMDLINE}) {
  # chstream run from the command line, check for a "-recommended" option
  if ($ENV{CLEARCASE_CMDLINE} =~ /-recommend /) {
    $msg->D( "this is a chstream to recommend a baseline",
             "CLEARCASE_CMDLINE is: <$ENV{CLEARCASE_CMDLINE}>",
             "trigger proceeding...",
           );
  }
  else {
    $msg->D( "EARLY OUT - this chstream command does not include a
              baseline recommend:",
             "CLEARCASE_CMDLINE is: <$ENV{CLEARCASE_CMDLINE}>",
           );
    exit 1;
  }
}
else {
  # chstream was run from the gui, must look at event records to
  # determine if the command was a baseline recommend or 
  # some other change to the stream
  my $lshist_rc = qx($CT lshist -minor -last 1 -me stream:$ENV{CLEARCASE_STREAM});
  if ($?) {
    # error in the lshist command, report trigger error
    my @args = ("$CP proceed -type error -default abort -mask abort -newline -prompt \"***RECOMMEND_BL Trigger Version: $VERSION***\n\n<lshist> cmd failed on
stream:$ENV{CLEARCASE_STREAM}.\nResults:\n$lshist_rc\nPlease send a
screen print of this error to your ClearCase admin.\" -prefer_gui");
    system (@args);
    $msg->D( "Processing aborted - lshist command failed!",
             "$lshist_rc"
           );
    exit 11;
  }
  chomp($lshist_rc);
  # check latest stream event record to see if the chstream was 
  # a baseline recommend or some other change to the stream.
  # a baseline recommend will have an event record of the form:
  # "Set activity process variable named "UCM_STREAM_RECBLS".
  if ($lshist_rc =~ /UCM_STREAM_RECBLS/) {
    $msg->D( "this is a chstream to recommend a baseline",
             "latest event record on stream is:",
             "$lshist_rc",
             "trigger proceeding...",
           );
  }
  else {
    $msg->D( "EARLY OUT - this chstream command did not include a baseline recommend:",
             "latest event record on stream is:",
             "$lshist_rc",
           );
    exit 1;
  }
}