Question

In Clear Case, I need to find all Versions that checked-in by me

In the example below, I need to find all versions checked-in by Loi Wang, on branch "mybranch"

>$ct desc HelloWorld.xml <br >
version "HelloWorld.xml@@/main/***mybranch***/9" <br >
  created 09-Sep-09.06:50:14 by ***Loi Wang*** (lwang.eng@compu10) <br >
  "Hello world issue " <br >
  Element Protection: <br >
    User : jsmith   : r--<br >
    Group: eng      : r--<br >
    Other:          : r--<br >
  element type: xml<br >
  predecessor version: /main/mybranch/8<br >
  Attributes:<br >
    ISSUE = "IS-123"<br >
Was it helpful?

Solution

The principle is to use cleartool lsco for checkout, and find for checking:

 cd c:\myView\myVob\...\mypath
 or
 cd /view/myView/myVob/.../myPath
 ct lsco -me -brtype myBranch -rec .

Note: you need to be in your view, and use the name of the branch without '@\PVobName' (a "non-qualified name")

In your case

 ct lsco -user lwang.eng@compu10 -brtype mybranch -rec .

This would give you all the elements having been checked-in:

 ct find . -user lwang.eng@compu10 -branch brtype(mybranch) -print

This would all the versions created during those checkins:

 ct find . -user lwang.eng@compu10 -version brtype(mybranch) -print

Again, mybranch is used in its "non-qualified" form

If the above does not work (it works for "-me" or "-user myName", but not necessarily for any other user), a simple grep could be enough:

 ct find . -version "brtype(mybranchv)" -exec "cleartool descr -fmt """%n %u\n""" %CLEARCASE_XPN%"|grep lwang.eng

OTHER TIPS

How about doing a ct lshistory , then grepping for your username.

That'd tell you all the versions of an element you'd created.

i.e on an element called foo.xml

ct lshistory foo.xml | grep spedge

You could even make it more complicated by grepping for the branch as well.

ct lshistory foo.xml | grep spedge | grep @@/main/my-branch
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top