Get ClearCase Snapshot Views via ClearCase Automation Library (CAL)?

允我心安 提交于 2019-11-26 18:38:42

问题


Is anyone using the ClearCase Automation Library (CAL) successfully to retrieve snapshot views? I can get all the dynamic views just fine, but not a single one of my snapshot views appears in the 'Connection.get_Views(true, region);' command...

Is there any way to get these programmatically as ICCView instances?


回答1:


How about:

Dim CC As New ClearCase.Application 
CC.Views(true, myRegionName)

It should gets the collection of views in the specified region, including snapshot ones.
(Note: this may be similar to what you proposed in your question, but with a more accurate CAL syntax)

For instance, I do confirm the following ccperl script does return snapshot and dynamic views:

Type 'ccperl listViews.pl', provided:

  • you did save the next line in a file named 'listViewws.pl'.
  • you replace 'myRegionName' by your current ClearCase region
  • you are using the same Region than the one in the script.

Script:

use Win32::OLE;
$DEBUG = 1;

print "Instantiating CAL CC\n" if $DEBUG;
my $cal_cc = Win32::OLE->new('ClearCase.Application')
or die "Could not create the ClearCase Application object\n";

$cclsview = $cal_cc->Views("False","myRegionName");
$Views_Entries = $cclsview->Count;
print "nbViews $Views_Entries\n";
$Views_Index = 1;
while ($Views_Index <= $Views_Entries) {
    print "Processing View entry $CS_Index\n" if $DEBUG;
    $View = $cclsview->Item($Views_Index);
    $ViewName = $View->TagName;
    $ViewIsSnapshot = $View->IsSnapShot;
    print "View $ViewName $ViewIsSnapshot\n";
    $Views_Index++;
}


来源:https://stackoverflow.com/questions/1193805/get-clearcase-snapshot-views-via-clearcase-automation-library-cal

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!