If the label has been set on the vob itself, and on all elements (for instance: /<vobtab>/dir1
, /<vobtab>/dir1/dir2/
, /<vobtab>/dir1/dir2/*
), then the following config spec would only bring the labelled elements, and not the rest of the vob elements:
element * checkedout
element * label_ID
element * -none
But if label_ID has been set on all elements within /<vobtab>/dir1/dir2/*
, and not on /<vobtab>/dir1/
(the parent folder itself) or not on /<vobtab>/
(the root folder of the vob itself), then that config spec would bring no elements at all.
A workaround would be to select the parent elements:
element * checkedout
element * label_ID
element /<vob_tag>/dir1 /main/LATEST
element /<vob_tag> /main/LATEST
element * -none
I would recommend doing this in a dynamic view (which can be refreshed very quickly after each config spec modification), instead of a snapshot view (which has to reload after each setcs
)
Another approach, not based on a config spec (since it can be difficult to select the right parent folders in order to access the labelled elements) is to use a cleartool find
query.
See:
Basically, you can list only the labelled element by going into your 'preferably dynamic) view and doing:
UNIX and Linux:
cleartool find -cview -element '{lbtype_sub(REL1)}' -print
Windows:
cleartool find -cview -element "{lbtype_sub(REL1)}" -print
Instead of using -print
, you can use -exec "a command"
, and use the exec option to execute any command, like copying what you just found:
cleartool find -cview -element "{lbtype_sub(REL1)}" -exec "copy \"%CLEARCASE_PN%\" c:\a\path"
cleartool find . –version "lbtype(LB_TYPE)"
If the command is too finicky, simply redirect the result to a file:
cleartool find -cview -element "{lbtype_sub(REL1)}" -print > file.txt
Then process that file to copy its content, as in "Batch: Copy a list (txt) of files":
@echo off
set src_folder=c:\whatever
set dst_folder=c:\target
for /f "tokens=*" %%i in (File-list.txt) DO (
xcopy /S/E/U "%src_folder%\%%i" "%dst_folder%"
)