Question

I have somehow created a branch of a file in clearcase UCM that is not part of an activity. I have no idea how to reproduce this, but my stream is showing many files with this symptom. How can I find these files, remove them, and prevent it from happening again in the future?

Here is an example of one such file, names redacted to protect the innocent:

xxxxxxxxxxx.cpp@@/main/xxx-integration/xxxxxx-xxxxxxxx/0 Rule: .../xxx-xxxxxxx/LATEST

A ct lsact -long | grep <filename> returns no results.

Update: I used a find command to track down all the files that are on the branch given (and redacted) above, though I still do not understand the issue.

Per VonC's answer, where is what I ended up doing:

cleartool find . -type f -version "version(.../xxx/LATEST)&&version(.../xxx/0)" -print | tee ~/tmp/files2

I then read through the list of files generated to make sure they made sense, then I verified they were not attached to an activity and removed the versions:

cat ~/tmp/files2 | while read
do 
    if [ -z "$(ct describe -fmt "%[activity]p" $REPLY)" ]
    then 
        ct rmbranch -f ${REPLY%/0}
    fi
done
Was it helpful?

Solution

That can happen ig those file were checkout in a base ClearCase view, ie a non-UCM view, withg a simple config spec:

element * .../xxx-integration/LATEST -mkbranch xxxxxx-xxxxxxxx

You can use a find command similar to "How can I find all elements on a branch with version LATEST that has no label applied?".
The difference is: for each version found, you need to describe it in order to check if there is an activity attached to it or not (with a fmt_ccase):

cleartool describe -fmt "%[activity]p" "$CLEARCASE_XPN"
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top