tags:

views:

153

answers:

2

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 >
+1  A: 

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
VonC
I need to list checked-in Issues, not checked-out ones, can you help please.
Mohammed
+1  A: 

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
Spedge
For *one* file, this is a good option. For *many* files, this would be much slower than the "cleartool find" command. Yet, +1.
VonC
@VonC Agreed - but the way I interpreted his question, he only wanted the versions of HelloWorld.xml :)
Spedge