In our continuous integration we use ClearCase UCM. We occasionally need to access the sources from the recommended baseline (which not necessarily equals the newest baseline). Note: All baselines are full.
I figured out how to access the sources belonging to the recommend baseline manually, by entering cleartool edcs
in the command line within the dynamic view and adding the line element * MyRecommendedBaseline
below # Select checked out versions
, saving and closing the text-file.
Unfortunately I don't know how to do this from a script. One way I could think about is read the contents of the config_spec into a stream, add the line, save it to a new text file and use "cleartool setcs newcs.txt"
.
But apart from being cumbersome I'm not exactly sure if this is possible. Anyone knows a simple way to do this?
Asked
Active
Viewed 241 times
1

airborne
- 3,664
- 4
- 15
- 27
1 Answers
1
You can script listing the recommended baselines of a given stream: see "How can I list the recommended base line in ClearCase"
On Windows:
cleartool descr -fmt "%[rec_bls]CXp" stream:streamName@\aPVob
On Unix:
cleartool descr -fmt "%[rec_bls]CXp" stream:streamName@/vobs/aPVob
From there, you can generate a new file with simple rules:
element * MyRecommendedBaseline1
element * MyRecommendedBaseline2
...
And you can setcs that file to a dedicate base-CC dynamic view (not an existing UCM view).
As Brian Cowan points out in the comments, this only works because those baselines, as the OP mentions, are full baselines (not incremental or not-labeled, like deliverbl
are).
See also "What is the difference between Full baseline and Incremental baseline in Clearcase UCM?".

VonC
- 1,262,500
- 529
- 4,410
- 5,250
-
Hi, thanks for your answer. Can those other values in the config_spec (# Component selection rules, ucm identity UCM.Stream oid:12212...) be omitted for the new file? – airborne Mar 01 '18 at 17:37
-
1In a base cc dynamic view, yes, keep only the main/latest rule as the final one. – VonC Mar 01 '18 at 17:52
-
1If these baselines are not fully labeled, this will not work. If the baselines in question are the recommended baselines of the parent stream, just create a new child stream using the recommended baselines and attach a view to the new stream. If the stream is set read-only you could just do a cleartool rebase -recommended to pick up subsequent changes. – Brian Cowan Mar 02 '18 at 13:26
-
@BrianCowan I don't follow: I only recommended that option *because* the OP mentioned "Note: All baselines are full". – VonC Mar 02 '18 at 13:29
-
1I missed that statement. There are 3 different baseline types: unlabeled, incrementally labeled, and fully labeled. All but the last would behave strangely in a base clearcase view. To avoid unpleasant surprises, use a build stream because there is no guarantee that someone 6 months down the road won't use an incremental baseline to save time. – Brian Cowan Mar 03 '18 at 14:40
-
1@BrianCowan Good point. I have edited the answer to make the full baseline element clearer. And I have added links illustrated the other types of baselines (incremental and unlabelled). – VonC Mar 03 '18 at 21:29
-
Thank you both for your helpful hints. We use an Integration stream as "build stream" where (full) baselines are exclusively created and recommended by Jenkins. Developers only deliver their work to that stream and don't create baselines on this stream. So I think we won't run in any trouble!? – airborne Mar 05 '18 at 09:49
-
@air No, you should be OK – VonC Mar 05 '18 at 09:50