I want to find all elements in a directory in ClearCase under a branch say BR1
where the label LABEL1
is not on latest of BR1
.
cleartool find . -ele "lbtype_sub(LABEL1) && brtype(BR1) && ! version(.../BR1/LATEST)" -print
This doesn't seem to be working.
What is the problem ?
The example of cleartool find
for versions not the LATEST is:
cleartool find . -version "{brtype(main_dev) && created_since(30-Apr) &&
(! created_since(31-May)) && (! version(\main\main_dev\LATEST))}" -print
So try:
cleartool find . -ele '{lbtype_sub(LABEL1) && brtype(BR1) && (! version(.../BR1/LATEST))}' -print
If it doesn't work for elements, do the query for version associated with an exec directive, in order to display the name of the element associated with the version found:
(see fmt_ccase
)
cleartool find . -ver '{lbtype_sub(LABEL1) && brtype(BR1) && (! version(.../BR1/LATEST))}' -exe 'cleartool descr -fmt "%En"'
And sort the list to remove any duplicate: %En
display the name of the element.
Warning: Note that will give you elements that also have a LATEST version on that branch BR1
, so you need to make a second query:
cleartool find . -ver '{lbtype_sub(LABEL1) && brtype(BR1) && version(.../BR1/LATEST)}' -exe 'cleartool descr -fmt "%En"'
That will give you all the elements which have a version in BR1/LATEST
.
Remove those elements from the first list, and you will get (finally) what you are after.
In short: -ele
doesn't work directly for this kind of query.