问题描述
我试图把版本信息,从最新的ClearCase的标签检索我的C#GUI框架。这最初是从如下视觉Soursafe完成。
I am trying to put version information to my C# GUI framework retrieved from the latest ClearCase label. This was originally done from Visual Soursafe as below.
vssDB = new VSSDatabaseClass();
vssDB.Open( databaseName, "vssadmin", "vssadmin" );
VSSItem item = vssDB.get_VSSItem( @"$\BuildDCP.bat", false );
foreach(VSSVersion vssVersion in item.get_Versions(0))
{
// Pull the first non-blank label and use that
if ( vssVersion.Label != "" )
{
labelID = vssVersion.Label.ToString();
break;
}
}
我想,因为我们改变了我们的源$ C $ C控制VSS至CC做使用ClearCase类似的事情。任何帮助将大大AP preciated。
I am trying to do something similar using ClearCase since we changed our source code control from VSS to CC. Any help would be greatly appreciated.
谢谢!
推荐答案
我相信这可以通过一个脚本,它会从你的C#程序中调用更好地实现。
I believe this could be better achieved through a script, which would be called from your C# program.
不过,您可以直接调用某些COM对象,通过的与ClearCase。
But you may be able to directly call some COM objects, through the CAL interface provided with ClearCase.
为接口的文档可以通过ClearCase的帮助(开始>程序>的Rational ClearCase> ClearCase的帮助),其中有一个为ClearCase的自动化库(CAL)的条目进行访问。另一种路径是在ClearCase / bin目录去寻找 cc_cal.chm
The documentation for the interface can be accessed through ClearCase help (Start>Programs>Rational ClearCase>ClearCase Help), where there's an entry for "ClearCase Automation Library (CAL)". An alternate path is to look in the ClearCase/bin directory for "cc_cal.chm".
在VB,与CAL API,将给予这样的:
In VB, with CAL API, that would give something like:
Dim CC As New ClearCase.Application
Dim labelID As String
Set aVersion = CC.Version("[Path-To]\BuildDCP.bat");
Set someLabels = Ver.Labels;
If (someLabels.Count > 0) Then
' the first label listed is the most recently applied
labelID = someLabels.Item(1).Type.Name
EndIf
这篇关于如何以编程方式从C#获取最新的ClearCase的标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!