Powershell to do Clearcase checkin ,checkout,find command?

强颜欢笑 提交于 2019-12-08 02:28:00

问题


How to do check-in /check-out /Find and etc operation in Clearcase UCM using powershell.

Is there any way custom cmd-lets are available for this?


回答1:


For more advanced functionality and better response times, I'd recommend accessing the CAL API directly via COM. The best documentation for that is available locally in <ClearCase install dir>\bin\cc_cal.chm.

$cc = New-Object -COM ClearCase.Application
$ccItem = $cc.Version("<absolute path to file/dir>")
$coItem = $ccItem.CheckOut($cc.ccReservedState,"",$false,$cc.Latest,$false,$false)
Write-Output $coItem.IsReserved



回答2:


You can find an example in this IBM bug report, where you would use in your Powershell session the CAL API (ClearCase Automation Library)

PS C:\temp> $ct = new-object -com ClearCase.ClearTool
PS C:\temp> $ct.CmdExec('checkout -nc aFile')

Or, as in this thread, you would use directly cleartool.

In both cases, you will need to make sure the view in which you are doing the checkout/checkin operation as an UCM activity set (cleartool lsact -cact -cview should return an activity name, if done within the view).



来源:https://stackoverflow.com/questions/8550121/powershell-to-do-clearcase-checkin-checkout-find-command

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