Thursday, 12 September 2013

How to find files in my current view that are on a specific branch?

How to find files in my current view that are on a specific branch?

Let's say I have two files: File1 and File2
In the version tree diagram below the * indicates the version of the files
my config spec grabs
Version Trees:
File1 has development on Branch2 but is now merged to branch main
| main |
|
(0)----| Branch2 |
| |
| (0)
| |
(1)*<------(1)
File2 is on Branch2 with multiple revisions
| main |
|
(0)----| Branch2 |
|
(0)
|
(1)
|
(2)*
Config Spec:
#Pick up Branch2 LATEST unless it has an outgoing merge hyperlink type
element * {version(.../Branch2/LATEST)&&!hltype(Merge,->)}
element * /main/LATEST
What I'd like to be able to do is find only the files that are on Branch2
that I'm currently looking at.
I've tried this:
cleartool find . -cview -type f -version "brtype(Branch2)" -print
It returns every version of every file that is on Branch2
.\File1@@\main\Branch2\0
.\File1@@\main\Branch2\1
.\File2@@\main\Branch2\0
.\File2@@\main\Branch2\1
.\File2@@\main\Branch2\2
I'd like only
.\File2@@\main\Branch2\2
What is the cleartool find command(s) that will return only File2 current
view version as a results? I'd prefer a one line command versus a multiple
step process.

No comments:

Post a Comment