Find changes between labels

With cleartool, I can find all the files associated with the label using something like:

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

How can I find all objects that have been changed (including adding and removing) between two labels?

+4
source share
4 answers

ClearCase (under the administration in my installation) has a report builder. In the "Items / Labels" section, you can select "Items Modified Between Two Labels" or "Versions Modified Between Two Labels", depending on what you need. Then you can choose a path for analysis and select two shortcuts for comparison.

After starting the process, you can save the results as HTML, XML or CSV.

+6
source

As mentioned in the answer to How to search for files by tag "

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

easier and lbtype_sub allows the request to be true if any version of the element has a 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 

will find all elements that do not have both labels, listing all versions in the current VOB marked as REL1 or REL2, but not both.

Note: if the label is the base base of UCM, this is even simpler ( ct diffbl ):

 ct diffbl -ver BL1@ \myPVob BL2@ \myPVob 
+3
source

There is another way to do this, where LABEL1 is the old label and LABEL2 is the last. Check the date the labels were created and replace them before issuing the command, as it prints the negation of the && conditional statement. It works like magic!

enter image description here

 $(cleartool find $PWD -ver "!lbtype($LABEL1) && lbtype($LABEL2)" -print) 
+3
source

To find all items that are also deleted or not selected by your config_spec, add –nvisible to the search options.

For comparison, I have a shell script called freeze-list that more or less runs the same find command as yours (redirecting output to <label>.versions ).

Then I have other perl scripts that take two such files, read them and compare each element. I have, for example, freeze-compare-text for simple output diff -u , freeze-compare-kdiff3 to start kdiff3 comparison for each file where there are some changes (with some intelligence, to avoid false positives when element 0 is on the new branch is identical to the start version, etc.). And I also have freeze-compare-diffstat (basically outputting output to diffstat).

If you are just interested in finding changes between shortcuts 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 that do not have the same version in label1 and label2.

0
source

Source: https://habr.com/ru/post/1304358/


All Articles