Index syndication
comment syndication

Clearcase Tips number 01

I found myself writing down example commands in clearcase (V6), so I thought I would share them. If you have ever needed to find files like you do in UNIX, but want to be clearcase specific, then these commands will give you a quick headstart on using the cleartool find command:

How do I list all files and file versions going into a specific build that is labelled?
Assume your label is TR1_PRE_RELEASE


  cleartool find . -version 'lbtype (TR1_PRE_RELEASE)' -print

How do I find the latest versions on branch xyz?
In this example, branch xyz is the tst branch

  cleartool find . -version 'version (.../tst/LATEST)' -print

How do I find the latest versions on xyz branch WITHOUT a specific label?
For this example the xyz branch is the main (default clearcase) branch, and the label is TR1_PRE_RELEASE

  cleartool find . -version 'version (/main/LATEST) && ! lbtype(TR1_PRE_RELEASE)' -print

How do I see what in the filesystem has changed from clearcase?
This example only works if you have set your view on the same machine where the file system to compare is.

  cd /<clearcase mount path>/
  clearfsimport -preview -recurse /<your app dir>/* .|grep -v unchan |grep -v identi

I hope that gives you incentive to go and read the clearcase find documentation and learn more for yourself by trying.

Clearcase Branches Solved?

I think I may have stumbled upon the answer. I’m so set in my CVS ways that I though the best thing was to branch the entire top level folder – recursively. What I really was after was a way of setting the configspec on the NEW view I create for the new branch, and making it show code that is labeled with a particcular label, then when it is checked out and in, a new revision exists on the new branch. The advantage here, is that my new view shows exactly what I need without the need for checking out a version of every file in that view.

This post over at the IBM Rational Clearcase forums describes EXACTLY what I was after, and explained it in the precise terms I needed. I’m thinking differently now, and if it works as I intend, then I shall write further about this adventure into SCM.

Clearcase Branches

I’m so used to making branches in CVS.


cvs tag -b system_test

As the CVS doco states simply, “This splits off a branch based on the current revisions in the working copy”, and these revisions will get assigned the branch name, in this case `system_test’. Simple, powerful enough and quick!

But Rational Clearcase is a different beast as I learn it. You have to make your branchtype.
cleartool mkbr system_test
All good so far.

Next I must merge stuff from the current mainline to my new branch, BUT I can only do it a file at a time or using findmerge??? When I do a dry run, the element does not exist in the new branch though so it says it will skip everything… Hmmm
On top of all this one must not forget to set your view configspec set to show this branch! (like a CVS Checkout with your branch tag being sticky).

No wonder people prefer CVS. Clearcase IS powerful once you know it, but the learning curve is huge.

So asking for help – if anyone actually reads this – any quick ways to branch the /main/LATEST into my new branch?

« Previous entries