I’m looking for a ClearCase command that will list all the elements that are visible in my current view, but do NOT have a particular label applied to them.
Say for example, most of the elements that are visible in my view have LABEL_X applied to them. I want a list of those elements that do not have LABEL_X.
I obviously need to use cleartool find, but the usage and ClearCase man page baffle me in terms of how to construct a query like this.
This should work:
Notes:
!andlbtype_sub(in winodws you do not need the space)-elevery IMPORTANT to get only one occurrence of a given file (and not all the different versions of a file matching a criteria)-elelimits the search to elements, not versions (that would trigger a lot more results with versions involved…)-alllist all elements included ‘deleted’ (that is ‘unreferenced’) ones.The second line lists only visible elements (in the current view)
You should execute those second command lines on the sub-directory of your choice within a given ClearCase (snapshot or dynamic view): all files within that sub-directory (and sub-sub directories…) matching the cirteria will be listed.
Warnings:
files and directories are listed. If you want only files, add
-type fto the query:ct find -type f -ele ‘!lbtype_sub(LABEL_X)’ -print
what is displayed is the extended path for elements, that is the name of the file followed with
@@.To list only the name without
@@, use ‘-nxn‘ (no extendedpathname option)Another more complex but also more complete way to list only the name without
@@, is to usedescr -fmt. For instance:would give you (in windows or unix syntax) the date and name of the files and directories not labeled LABEL_X.
With that ‘
descr -fmt‘ display, you can combine any kind of information and presentation you want for the result.