tags:

views:

55

answers:

3

Using cleartool I am able to find all the files associated with a label using something like:

ct find -avobs -version "lbtype (Build-Label)" -print

How do I find all objects changed (including adds and deletes) between two labels?

A: 

To find all elements, also those deleted or not selected by your config_spec, add –nvisible to the find options.

For comparision I have a shell script called freeze-list which more or less runs the same find command as you have there (redirecting the output to <label>.versions).

I then have some other perl scripts which takes two such files, reads them and compares each element. I have for instance freeze-compare-text for a plain diff -u output, freeze-compare-kdiff3 to start kdiff3 comparision on each file where there are some changes (with some intelligence to avoid false positives where the 0 element on a new branch is identical with the starting version etc). And I also have a freeze-compare-diffstat (basically piping the output to diffstat).

If you just are interested in finding changes between to labels as a one time operation, you can run

ct find -avobs –nvisible -version "lbtype(label1)" -print | sort > label1.versions
ct find -avobs –nvisible -version "lbtype(label2)" -print | sort > label2.versions
comm -3 label1.versions label2.versions

which will list all elements which do not have identical versions in label1 and label2.

hlovdal
A: 

In ClearCase (under Administration in my install) there is Report Builder. Under Elements/Labels you can select either "Elements Changed Between Two Labels" or "Versions Changed Between Two Labels" depending on which you need. You can then select the path to analyze and select the two labels to compare.

After the process runs you have the option to save the results as HTML, XML, or CSV.

brainimus
A: 

As mentioned in the answer to "How to search files by label"

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

is simpler and lbtype_sub allow the query to be true if any version of the element has the label
(see query_language man page)

cleartool find -all -element '{lbtype_sub(REL1) && lbtype_sub(REL2)}' ^ 
  -version '{(lbtype(REL1) && ! lbtype(REL2)) || ^
  (lbtype(REL2) && !lbtype(REL1))}' -print 

would find all elements that do not have both labels, listing all versions in the current VOB labeled either REL1 or REL2 but not both.

Note: if the label is a UCM baseline, this is off course even simpler (ct diffbl):

ct diffbl -ver BL1@\myPVob BL2@\myPVob
VonC