Search code examples
findlabelbranchclearcase

how to find the branch for a given label


I try to use:

cleatool lstype lbtype:some_label

but the output does not tell me which branch the label is in.
So I need your help.


Solution

  • A label is not associated with a branch but with versions.
    And those versions can be created on various branches.

    If your label is an UCM baseline, then you can easily find the stream (and the corresponding branch) by typing:

    cleartool lsbl some_label@\aPVob
    

    But if it is a non-UCM label, you need to display the branches of the versions where that label has been put for a given VOB (and you may have set that label on different VOB too)

    Some query like:

    cleartool find -all -branch "{lbtype_sub(some_label)}" -print
    

    (lbtype_sub and not lbtype because the type being queried (label) does not apply to the "level" (-branch) being queried. Here, query for a label using -branch ... labels are only on versions within elements and branches.

    If you have Cygwin or GnuWin32, you can refine to only display the branches:

    cleartool find . -branch "{lbtype_sub(some_label)}" -print | gawk "{gsub(/.*@@.*\\\\/,\"\");print $0}"|c:\Cygwin\bin\sort.exe -u