Find changes between labels

后端 未结 4 1755
滥情空心
滥情空心 2020-12-15 12:07

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
         


        
相关标签:
4条回答
  • 2020-12-15 12:47

    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.

    0 讨论(0)
  • 2020-12-15 13:00

    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.

    0 讨论(0)
  • 2020-12-15 13:02

    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
    
    0 讨论(0)
  • 2020-12-15 13:03

    There is a another way to do it , where LABEL1 is the old label and LABEL2 is the latest. Check the date of creation of the labels and swap them before issuing the command as it prints the negation of the && conditional statement. Works like magic!

    $(cleartool find $PWD -ver "!lbtype($LABEL1) && lbtype($LABEL2)" -print)
    
    0 讨论(0)
提交回复
热议问题