1

I would need a ClearCase query command to be able to find all versions of elements in a ClearCase VOB that have labels applied after a certain date

I have tried the following commands, but I hope there is a better way, and also to avoid redundancies in the listings when an element has two or more labels applied after the selected date

cleartool lstype -kind lbtype -short -invob MY_VOB > /tmp/All_VOB_labels.txt
 
for SOME_LABEL in $(cat /tmp/All_VOB_labels.txt )
 do
   cleartool find . -version "lbtype($SOME_LABEL)" -exec "cleartool lshistory -since 28-Feb -minor $CLEARCASE_XPN " 
 done   

Any help appreciated, TIA, Javier.

2 Answers2

0

determine all element versions in a VOB that have labels applied after a certain date

The normal query would be:

cleartool find <vob-tag> -version 'lbtype_sub($SOME_LABEL) && created_since(date)' -print

That would list only versions (created after a certain date) with a label.

That seems more straightforward than -exec "cleartool lshistory -since 28-Feb -minor $CLEARCASE_XPN", which list any version created after a certain date, even if they do not have the label applied.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
0

Iterating through the list of labels that way is exceedingly inefficient. What is the concern underlying this question?

Depending on what you're looking for, this may have no simple answer...

If you have a label type that was created on January 1, 2022, and you want to see when -- after March 1, 2022 -- the label was applied, that may actually be impossible. As application of a label is considered a "minor" event and the date/time of application may be scrubbed out of the VOB during regular maintenance.

If you're looking at the last 30 days or so, that would be different and should work as the "minor" events should still be there. In that case you may be able to run cleartool lshistory -all -min -since 28-Feb-2023 while in the VOB root directory and parse the output.

New label applications will look like this:

--03-07T16:27  brian.cowan make label "7-MAR-2023-LABEL2" on directory version ".@@\main\43" (7-MAR-2023-LABEL2)

But again, it depends on the underlying concern.

Brian Cowan
  • 1,048
  • 6
  • 7