Search code examples
clearcasecleartool

Find files selected by the config spec with specific properties in Clearcase


I am using Clearcase dynamic view with a complex config spec. I need a command line command to find files where the version selected by the config spec has a specific property, such as:

  • has a specific label
  • does not have a specific label
  • is on a specific branch
  • etc.

I was looking at the documentation of the cleartool find command, but found no rule such as "version selected by the config spec".


Solution

  • A simple

    cleartool describe -l /path/to/your/view/path/to/your/file
    

    should be enough to display all the informations you need.

    Combine that with the fmt_ccase formatting options page, and you can display directly only the label and the branch name:

    cleartool describe -fmt "%Sn %l" /path/to/your/view/path/to/your/file
    

    See:

    %Sn
    

    Short name:
    For a version, a short form of the version ID: branch-pathname/version-number.
    For other objects, the null string.


    Now, if you want to find all files with a version of a specific property within your view, use the -cview option of find.
    See "Additional examples of the cleartool find command":

    To print all versions selected by your view that have a LABEL applied:

    cleartool find . -cview -version "lbtype(LABEL)" -print
    

    Following the same idea:

    To print all versions selected by your view that are in a given branch:

    cleartool find . -cview -version "brtype(BRNAME)" -print