I am attempting to check in hundreds of new files in Base ClearCase. Due to network and server issues, I am wanting to write a batch script of cleartool commands to add each file to source control. All files will be checked in under a single ClearQuest task.
I have tried selecting all the files and adding all at once via the context menu, but after selecting the ClearQuest task association and choosing "apply to all", I am still having a dialog box pop up for every file, asking me to confirm the association.
I want to write a list of commands like:
cleartool mkelem -c "SCR ... / TASK ... - blah blah" filename.ext
However, I don't know how to associate the change with the TASK, and I don't see any documentation for doing this in Base CC/CQ.
First, don't write a script adding new files throug mkelem: if you can isolate those files in their own folder (or tree of folders) outside a view, then you can import them into a view (snapshot or dynamic) through clearfsimport
.
clearfsimport
is made for that, and will checkout the parent folder of the files to add, and do the required mkelem
for each file for you.
See also "How can I use ClearCase to “add to source control …” recursively?"":
clearfsimport -preview -rec -nset c:\sourceDir\* m:\MyView\MyVob\MyDestinationDirectory
You will need first to use cleartool settask
in order to set the ClearQuest task for the destination view used for this import.
See "How to configure base ClearCase to use the Change Management integration with ClearQuest".
As the OP Darthfett adds in the comments:
However, as I am using ClearCase 7.*, there is no
settask
command.
As a workaround, it looks like usingset CQCC_AUTO_ASSOCIATE=<TASK ID>
will work (see here)