首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何知道谁推荐了ClearCase基线?

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

Stack Overflow用户
提问于 2015-03-11 03:48:38
回答 1查看 198关注 0票数 1

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

EN

回答 1

Stack Overflow用户

发布于 2015-03-11 03:55:56

我不认为元数据是被记录的。

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

代码语言:javascript
复制
POLICY_CHSTREAM_UNRESTRICTED

如果没有设置,这意味着只有UCM项目的所有者可以更改流上的推荐基线。

否则,就像下面建议的那样,您将需要通过触发器自己捕获和记录该事件。

在ClearCase 7.x方面(CC8可能已经改变了),这是通过chstream上的预操作触发器完成的,但它必须处理两种类型的交互:

  • CLI (cleartool chstream -recommended)
  • GUI (通过"recommend“上下文菜单)

有关实例this thread,请参阅

recommend_bls触发器,可提前检查chstream是否未达到推荐的基线:

代码语言:javascript
复制
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;
  }
}
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/28972808

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档