1

I am trying to find all versions on a particular branch, but the config spec of my working view should not matter (I want to work in a view with /main/LATEST).
I am working on Windows. Assuming that the version has been created before 27.May.17:47 and I don't want to see the 0 version on my branch.

I tried to do that by using cleartool find:

cleartool find M:\my_view.dv\MY_VOB\folder_x\folder_y\ -version "brtype(my_branch) && ! created_since(27-May.17:47) && ! version(...\my_branch\0)" -print

That works for all elements that have got at least a version \main\1 or later from which the element has been branched off to my_branch.
But for an element which has just got version \main\0 (because it has been created with a rule like "element * \main\0 -mkbranch my_branch") it does not work.

So I tried using another cleartool find with "-nvisible", but "-nvisible" does not work without "-all". So I have to use following:

cleartool find M:\my_view.dv\MY_VOB\folder_x\folder_y\ -all -nvisible -version "brtype(my_branch) && ! created_since(27-May.17:47) && ! version(...\my_branch\0)" -print

But because of the "-all" option my path "M:\my_view.dv\MY_VOB\folder_x\folder_y\" is completely ignored. Instead of just searching in my path it is searching the whole VOB, which is not what I want. Because it also gives me files under "M:\my_view.dv\MY_VOB\folder_z\" as result.

So I either need to modify first query that it will give me also elements that have been created with "element * \main\0 -mkbranch my_branch", or I need a second query that gives me elements that have been created with "element * \main\0 -mkbranch my_branch" under a certain path only...

Any idea how to solve the problem without an additional script?

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
Jonas
  • 31
  • 3

2 Answers2

0

Looking at query language used by cleartool find, you can use compound queries

query && query
query || query ! query ( query )

That means you could try and select:

  • any version but the mybranch/0: ! version(...\my_branch\0)
  • OR:
  • any version 0 which does not have a version 1: version(...\my_branch\0) && ! version(...\my_branch\1)

Something like:

brtype(my_branch) && ! created_since(27-May.17:47) && \
( ! version(...\my_branch\0)
  || \
  ( version(...\my_branch\0) && ! version(...\my_branch\1) ) \
)

To be complete, that might select the version 0 of a file for which multiple versions have been created on mybranch, but the version 1 have been deleted (rmver).
I don't think this would be too frequent though.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • @Jonas I thought you wanted to avoid the `.../myBranch/0` version (unless the `0` version is the only one on `myBranch`) – VonC May 29 '15 at 08:58
0

The goal is to get a list of all element versions on a branch "my_branch" under a certain path only, but the view and its config spec should not matter. So it does not matter what kind of query I use because if the element itself is not selected by the view I am using to run the cleartool find, then it won't give me any of its versions as a result. If an element has just got version /main/0 but also a version .../my_branch/1 then it is not selected by a view with a config spec element * CHECKEDOUT \ element * /main/LATEST, so even if the query itself would list that element, it will anyway not be processed because of the view does not select it... So the solution should be to add -nvisible, so all elements will be processed even if they are not selected by the views config spec. But to add -nvisible without adding -all too is not possible... As soon as I add -all the find command will ignore my given path and search the whole VOB.

Jonas
  • 31
  • 3