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).
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.
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).
cleartool find somedir -exec "cleartool checkout -nc \"%CLEARCASE_PN%\""
Also an article "ClearCase: The ten best scripts" might be helpful
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With