How can I interact with ClearCase from Perl?

Basically, ClearCase Perl scripting is based on parsed outputs of system and cleartool commands. 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; } … Read more

Recursive checkin using Clearcase

I would recommend this question: Now the problem is to checkin everything that has changed. It is problematic since often not everything has changed, and ClearCase will trigger an error message when trying to check in an identical file. Meaning you will need 2 commands: ct lsco -r -cvi -fmt “ci -nc \”%n\”\n” | ct … Read more

Any way to use a custom diff tool with cleartool/clearcase?

How to change default diff tools You can specify an external diff tool by modifying the file map, in “c:\program files\rational\ClearCase\lib\mgrs” The WinMerge suggested by Paul actually modifies that file. Each map line has 3 parts: the CC filetype, the CC action, and the application. Find the section in the map file for text_file_delta file … Read more

How do I create a snapshot view of some project or stream in ClearCase?

2… 1 cleartool descr -l project:myProject@\myPVob with some grep, you have the list of components (writable or not) and policies. If you want only the Streams: cleartool lsproj -tree myProject@\myPVob You can repeat that for a Stream (to get the sub-streams) cleartool lsstream -tree myStream@\myPVob For the foundation baselines of a Stream: cleartool descr -fmt … Read more

How to obtain UCM stream and baseline with cleartool?

If you are in a view, you can: get the current stream cleartool lsstream -cview get all baselines for a component in that stream cleartool lsbl -comp myComp@\myPVob -stream myStream@\myPVob get all foundation baselines for that stream cleartool descr -fmt “%[found_bls]CXp” stream:myStream@\myPVob Don’t forget that in a view on a stream with a modifiable component, … Read more

How do I roll back a file checked in to Clearcase?

What is described by skwllsp can be be done in a dynamic view through the use of extended pathnames cd m:/myDynamicView/MyVob/path/to/file cleartool lsvtree myFile cleartool checkout -c “cancel co” myFile copy myFile@@/main/xx myFile cleartool checkin -nc myFile with xx being the version number you want to restore. But should you have made multiple checkins, including … Read more

Proper ‘cleartool mkview’ for ClearCase Snapshot view creation

This is usually due to the albd not running. Actually, it is running, but ClearCase tries to contact the wrong host. Here: Host-local path: Eh40yd4c:D:\Views\battjo6r_view2.vws is highly suspicious. Try: mkview -snapshot -tag battjo6r_view2 -vws \\Eh40yd4c\Views\battjo6r_view2.vws -host Eh40yd4c -hpath \\Eh40yd4c\Views\battjo6r_view2.vws -gpath \\Eh40yd4c\Views\battjo6r_view2.vws battjo6r_view2 That is: hpath = gpath. or, if the first command fails, also (it … Read more

tech