gpt4 book ai didi

perl - 我如何与 Perl 中的 ClearCase 交互?

转载 作者:行者123 更新时间:2023-12-02 07:53:34 24 4
gpt4 key购买 nike

我的项目需要使用 Excel 工作表中的 Perl 脚本从 ClearCase 数据中提取一些东西,它们是 -
通过给出两个特定的时间线或两个基线。

  1. 该基线内相关的所有事件(列标题“事件”)
  2. 所有者的 ID(列标题 - 所有者)
  3. 与特定事件关联的所有元素。 (列标题-“元素详细信息”)
  4. 对于每个元素关联的版本(列标题 - “版本”)
  5. 每个元素的代码总行数、添加的代码总行数、删除的代码总行数、更改的代码总行数..(列标题“代码行数” ,"添加的代码行","删除的代码行"& "更改的代码行")

请帮我解决这个问题......

最佳答案

基本上,ClearCase Perl 脚本是基于系统和 cleartool 命令的解析输出。

脚本基于 cleartool run cmd,如 package CCCmd ,并像这样使用:

use strict;
use Config;
require "path/to/CCCmd.pm";

sub Main
{
my $hostname = CCCmd::RunCmd('hostname');
chomp $hostname;
my $lsview = CCCmd::ClearToolNoError("lsview -l -pro -host $hostname");
return 1;
}

Main() || exit(1);
exit(0);

例如。

因此,一旦您掌握了基本的 Perl 结构,您所需要的就是基于 fmt_ccase 的正确的 cleartool 命令进行分析。指令。

1/ all the activity associated within that baseline (column header "activity")

 ct descr -fmt "%[activities]CXp" baseline:aBaseline.xyz@\ideapvob

这将为您提供事件列表(以“,”分隔)。

对于每个事件:

2/ Owner's id (column header-Owner)

 ct descr -fmt "%u" activity:anActivityName@\ideapvob

3/ all the element associated within a particular activity. (column header-"element details")

不确定:事件可以列出它们的版本(参见/4),而不是简单地列出它们的元素

4/ For each element the versions associated (column header-"Versions")

对于给定的事件:

 ct descr -fmt "%[versions]CQp\n"  activity:anActivityName@\ideapvob

5/ for each element the total number of lines of code,total number of lines of code added,total number of lines of code deleted,total number of lines of code changed..(column header"No. of lines of code","lines of code added","lines of code deleted" & " lines of code changed")

这可能相当长,但对于每个版本,您都可以计算先前版本的扩展路径并进行比较。

我建议使用动态 View ,因为您可以从那里访问文件的任何版本(与快照 View 相反)。

关于perl - 我如何与 Perl 中的 ClearCase 交互?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2273200/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com