如何与Perl中的ClearCase进行交互? [英] How can I interact with ClearCase from Perl?

查看:102
本文介绍了如何与Perl中的ClearCase进行交互?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

My project needs couple of things to be extracted from ClearCase data using the Perl script in a excel sheet,those are -
By giving two particular time line or two baseline.

  1. 与该基准关联的所有活动(列标题活动")
  2. 所有者的ID(列标题-所有者)
  3. 与特定活动关联的所有元素. (列标题-元素详细信息")
  4. 对于每个元素,相关的版本(列标题-"Versions")
  5. 对于每个元素,代码行的总数,已添加代码行的总数,已删除代码行的总数,已更改代码行的总数..(列标题代码行数" ,已添加代码行",已删除代码行"和已更改代码行")

请在这方面帮助我...

Please kindly help me on this...

推荐答案

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

Basically, ClearCase Perl scripting is based on parsed outputs of system and cleartool commands.

这些脚本基于运行cleard的cmd,例如 程序包CCCmd ,像:

The scripts are based on a cleartool run cmd like package CCCmd, and used like:

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结构,您只需根据

So once you have the basic Perl structure, all you need is the right cleartool commands to analyze, based on fmt_ccase directives.

1/该基线内关联的所有活动(列标题活动")

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

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

这将为您提供活动列表(以','分隔).

That will give you the list of activities (separated by ',').

对于每个活动:

2/所有者的ID(列标题-所有者)

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

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

3/与特定活动相关联的所有元素. (列标题-元素详细信息")

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

不确定:活动可以列出其版本(请参见/4),而不是其元素

Not sure: activities can list their versions (see /4), not easily their elements

4/对于每个元素,关联的版本(列标题-版本")

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

对于给定的活动:

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

5/每个元素的总行数,已添加的总行数,已删除的总行数,已更改的总行数..(列标题代码",已添加代码行",已删除代码行"和已更改代码行")

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")

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

That can be fairly long, but for each version, you can compute the extended path of the previous version and make a diff.

我建议所有人都使用动态视图,因为您可以从那里访问文件的任何版本(而不是快照视图).

I would advise using for all that a dynamic view, since you can access any version of a file from there (as opposed to a snapshot view).

这篇关于如何与Perl中的ClearCase进行交互?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆