tags:

views:

36

answers:

2

Hi!

Let's say I have a vob of 100 elements. Of the 100, I created my own branch off of the latest versions of the respective trunks. Let's say I did this a week ago. Today, I want to see if any of the trunks of the 10 elements have a version that is newer than the one off of which I branched a week ago. Of course, one way to do this would be to look at the version trees of all 10 elements, but is there a command I can run that will automatically look through the vob, find the 10 elements that have my branch, and check if there are versions on the trunks that are newer than the ones off of which I branched?

+1  A: 

First of all, when you create a branch, there isn't a new version on that branch for all files.
There will actually be a branch created for a given file only if that file has a checkout/checkin operation with a config spec set to make that branch.

Now, you can find here (IBM) or here some example of request you can run to find those versions:

cleartool find . -version "brtype(myBranch)" -print

would print all versions in your branch.

If you combine that with a time query:

cleartool find . -version "{created_since(date1) && brtype(myBranch)" -print

, you should get exactly what you want.


The OP adds though:

I'm not looking for elements where my branch was created after a certain date.
I'm looking for elements which have my branch (created on any date) AND have a version on the trunk which was created after I created my branch from the trunk

"element" is the key word here: when you want to list files based on more than one version, you are looking first for "elements" (i.e. files and directories), with (in second) versions matching the relevant criteria.

cleartool find . -element "{brtype(myBranch)" -version "{created_since(date1) && brtype(trunk)" -print

but that would not guaranty the version on "trunk" has been created after the one on "my_branch".

For that you will have to script it, with first:

cleartool find . -element "{brtype(myBranch)" -exec "cleartool descr -fmt \"%n %d\" \"%CMEARCASE_XPN%\"" > afile

, and then use the file to build the relevant find directive for each file and versions found.
You will have to play with fmt_ccase in order to display a data format compatible with a date query.

VonC
Thanks for your reply! However, perhaps I did not ask my question very clearly. I'm not looking for elements where my branch was created after a certain date. I'm looking for elements which have my branch (created on any date) AND have a version on the trunk which was created after I created my branch from the trunk. Hope that clarifies my question.
@ryanmark: just updated my answer to take into account your specific search criteria. This is not a fully-baked solution though.
VonC
A: 

Hi

Why not use the merge function to see if there is anything on the main branch that has been updated version-wise ? If you run a find merge between main and your branch, (keeping main as the source and branch as the destination) - you should get an idea of what has changed on trunk meanwhile. Hope this helps.

PS: You can use the clearcase merge manager to do this on windows.

Critical Skill