Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I perform a recursive checkout using ClearCase?

I want to check out all files in all subdirectories of a specified folder.

(And it is painful to do this using the GUI, because there is no recursive checkout option).

like image 893
jm. Avatar asked Aug 28 '08 22:08

jm.


People also ask

What is checkin and checkout in ClearCase?

The two-part checkout/checkin process extends a branch of an element version tree with a new version. The first part of the process, checkout, expresses your intent to create a new version at the current end of a particular branch. The second part, checkin, completes the process by creating the new version.


2 Answers

Beware: ClearCase is File-centric, not repository centric (like SVN or CVS).

That means it is rarely a good solution to checkout all files (and it can be fairly long with ClearCase ;) )

That being said, the question is perfectly legitimate and I would like to point out another way:

open a cleartool session in the 'specified folder':

c:\MyFolder> cleartool
cleartool> co -c "Reason for massive checkout" .../*

does the trick too. But as the aku's answer, it does checkout everything: files and directories... and you may most not need to checkout directories!

cleartool find somedir -type f -exec "cleartool checkout -c \"Reason for massive checkout\" \"%CLEARCASE_PN%\""

would only checkout files...

Now the problem is to checkin everything that has changed. It is problematic since often not everything has changed, and CleaCase 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
ct lsco -r -cvi -fmt "unco -rm %n\n" | ct

(with 'ct being 'cleartool' : type 'doskey ct=cleartool $*' on Windows to set that alias)

Note that ct ci -nc will check-in with the comment used for the checkout stage.
So it is not a checkin without a comment (like the -nc option -- or "no comment" -- could make believe).

like image 58
VonC Avatar answered Nov 08 '22 23:11

VonC


cleartool find somedir -exec "cleartool checkout -nc \"%CLEARCASE_PN%\""

Also an article "ClearCase: The ten best scripts" might be helpful

like image 24
aku Avatar answered Nov 08 '22 22:11

aku