Wednesday, September 10, 2008

Baseline vs. Label

When comparing elements or versions in UCM, many people use baseline the same way as label in Base ClearCase. For example, to find out all elements changed between two version, use the command:

cleartool find -all -element '{lbtype_sub($LABEL1) && lbtype_sub($LABEL2)}' -version '{(lbtype($LABEL1) && ! lbtype($LABEL2)) || (lbtype($LABEL2) && !lbtype($LABEL1))}' -print

Full baseline name can be used to substitute the LABEL1 and LABEL2 variable in the command in UCM.


However, baselines are different from labels. A full baseline labels every elements in the stream, no matter they are visible or not; while label only applies to visible elements selected by the view. This implies that you cannot use two baseline names to find out which elements have been deleted (renamed) between two baselines. The following command will fail to give out the removed files.

cleartool find . -element 'lbtype_sub($BASELINE1) && !lbtype_sub($BASELINE2)' -print

If you have labeled every elements selected by the two baselines respectively, you can get deleted files by command:

cleartool find . -element 'lbtype_sub($LABEL1) && !lbtype_sub($LABEL2)' -print

8 comments:

  1. nice blog , i work on clearcase ucm too and came across the blog by chance

    ReplyDelete
  2. A way of comparing baselines in clearcase is to use either the GUI of the ClearCase Project Explorer on the component (Select a component > Browse Baseline to get the baseline tree, then right click on a baseline to compare it with another one - you can access the difference in file versions if you have a view on the integration stream) or to use the cleartool diffbl command.

    One thing to know:

    The CLI "default" for getting the differences in term of file versions is:

    diffbl –versions baseline-selector1 baseline-selector2

    But the GUI "default" is the equivalent of

    diffbl –versions -nmerge baseline-selector1 baseline-selector2

    To get the equivalent of the CLI default behaviour in the GUI, you should tick the "Show All versions" option.

    ReplyDelete
  3. Hi , I have tried using diffbl command to find out list of files modified between two baselines as follows:

    cleartool diffbl -ver baseline1 baseline2

    But it didnt work. Please advise.

    ReplyDelete
  4. click to find out more Dolabuy Celine Learn More Here Balenciaga Dolabuy Visit Website Chrome-Hearts Dolabuy

    ReplyDelete