In ClearCase, I need a list of changes between two labels. Please help?

saku build's picture
saku build asked on January 4, 2012 - 12:39pm | Replies (4).

As i need list of the file changes between two labels and diff of the versions(components) of the two labels in my view in unix ,tried the below commands . Can any one pls help better way .

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

4 Answers

Marc Girod's picture

I lack a bit of background to say whether this would better, and in what sense...

ct -avob -ele 'lbtype_sub(label1) &&!lbtype_sub(label2)' -nxn -print
ct -avob -ele 'lbtype_sub(label2) &&!lbtype_sub(label1)' -nxn -print
for f in $(ct -avob -ele 'lbtype_sub(label1)' -ver 'lbtype(label2) &&!lbtype(label1)' -nxn -print); do echo 'diff -diff "$f@@/label1" "$f@@label2"'; done | cleartool

It won't be fast...

Maybe you know more about the vobs where the labels may be found or things like that. I also forgot what comm does exactly...

Next, I didn't test my commands. There may be typos, especially with the quoting.

Finally, there is a hidden/unsupported command which I have probably mentioned 10 times or so in the past but do not remember now (home), and which reports actvity between labels. It may apply here.


m_k_sudhir's picture
m_k_sudhir replied on January 24, 2012 - 8:15am.

If you are using Windows environment, you can go for Reporting Wizard. There you have the option of generating report for versions changed between labels.
Hope this helps. Cheers :)

saku build's picture
saku build replied on January 31, 2012 - 10:13am.

Hi All,

I need the changes between the two lables in clearcase ucm .

As i am using the below script to get the changes or checkin files data between tho baselines . ia m getting errors. please have a look .

#! /bin/bash
# Script to show diffs between 2 ClearCase labels

#cleartool location
export CT=/usr/atria/bin/cleartool

function usage() {
echo "Usage: <new_label> <old_label>"

if [ $# -ne 2 ] ; then
echo -e "\t-- New label: $1 --"
echo -e "\t-- Old label: $2 --\n"

${CT} find . -version "{(lbtype($1) && ! lbtype($2))}" -exec 'cleartool describe -fmt "%Xn \t\tBy: %Fu (%Lu) \n" $CLEARCASE_PN' | grep -E '.*\.(c|cpp|h|hpp|xml)@'

Sanat Ranjan's picture

ct find . -ver "lbtype(label2) &&! lbtype(label1)" -print.

check the above command from top directory of VOB.

CMCrossroads is a TechWell community.

Through conferences, training, consulting, and online resources, TechWell helps you develop and deliver great software every day.