hook - ClearCase.ClearTool returns No view context available error -
i trying run following code, got #error 1
@ startview
command, , #error 2
in desc
command.
use win32::ole; $ct = win32::ole->new('clearcase.cleartool') or die "could not create cleartool object\n"; $view = "ccadm01_uark_dev"; $output = $ct->cmdexec("pwv") or die("cleartool returned error: ", win32::ole->lasterror(), "\n"); print ("pwv \$output = $output\n"); # error 1 : cleartool return error 0 $output = $ct->cmdexec("startview ccadm01_uark_dev") or die("cleartool returned error: ", win32::ole->lasterror(), "\n"); $cwd = $view_dir; print( "current directory: $cwd\n"); # error 2: no view context available $output = $ct->cmdexec("describe -fmt \"%[versions]cp\" activity:usr0200004985\@\\unix_pvob") or die("cleartool returned error: ", win32::ole->lasterror(), "\n"); print ("desc \$output = $output\n");
for #error 1, tried same command dos, works.
you need make sure $view
valid dynamic view tag cleartool startview
work.
(make sure not use cleartool setview
, spawns subshell)
also if returns error 0, can assume has worked: cal might return "error", status 0 should mean command has been executed.
an error different 0, though, means went wrong.
and need cd
view (/view/<viewtag>
or m:\<viewtag>
) cleartool descr
work.
one, executed in wrong folder, supposed fail, hence "error 2".
the op jirong hu points in comments using perl rational clearcase automation library (cal) , this script example.
Comments
Post a Comment