2

I have a folder in clearcase, that contains 100+ files, some of them have labels, the others not. I need a fast way to get all labeled files only. Right now i tried using ct ls -short path\to\folder to list all files and then i have used ct lsvtree path\to\folder\file to check, wether the file contains labels or not. The way i am currently using works, but it's very slow, is there a simple command to detect all the files with labels?

Thomas Richter
  • 833
  • 8
  • 20

1 Answers1

2

The IBM page "Additional examples of the cleartool find command" has many examples, like:

cleartool find -all -element '{lbtype_sub(REL1)}' -print

That will find files with one of their versions having label REL1.
The reverse search is "How to find elements that do NOT have a particular label"

As a quick workaround, you could:

  • list labels

    cleartool lstype -kind lbtype -invob vob_path_and_name -short
    
  • for each one:

    cleartool find -all -element '{lbtype_sub(alabel)}' -print
    

To quicken the all process a bit, you could group several labels togethers:

 cleartool find -all -element '{lbtype_sub(alabel)||lbtype_sub(alabel2)||...}' -print
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Ok this is useful when the label name is known. Is there a way just like "if has a label"? Or some regex pattern like `*`, because the label name is not known before :/ – Thomas Richter Jul 11 '16 at 07:43
  • @ThomasRichter No wildcard possible, as illustrated in http://stackoverflow.com/a/3342688/6309 – VonC Jul 11 '16 at 07:45
  • Tanks. That is unfortunate. Ok do you still have an idea how to accomplish a solution? – Thomas Richter Jul 11 '16 at 07:48
  • 1
    @ThomasRichter I have edited the answer to propose a simple workaround. I am still checking if there is a more native solution though. – VonC Jul 11 '16 at 07:54
  • @ThomasRichter no obvious native solution, let's wait for other ClearCase speciallists to chime in. – VonC Jul 11 '16 at 09:13