1

Can some one please help me with ClearCase command to deliver baselines from one stream to another stream.

I have a project stream xyz_1.1.0: we have created a new stream by using release id 1.1.0 to provide a fix. The new stream can 1.1.0.17001.
Now when the stream is generated, it contains the foundation baseline from 1.1.0 but I want baselines the latest fix which is went over 1.1.0 for example it can be 1.1.0.17000... in which case I want to apply baselines of 1.1.0.17000.

We use common stream to do our checkins, hence I can get the latest baselines from common stream which can be found under recommended baselines.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
A.Learn
  • 158
  • 14
  • intra-project deliver? or outside the project? (https://stackoverflow.com/a/10005469/6309). In both case, you need `cleartool deliver`: https://www.ibm.com/support/knowledgecenter/en/SSSH27_9.0.0/com.ibm.rational.clearcase.cc_ref.doc/topics/ct_deliver.htm. I will post an answer later today. – VonC Sep 18 '17 at 13:20
  • Intra project... graphically i can use project explorer ->right click on stream->deliver baselines to alternative target... – A.Learn Sep 18 '17 at 16:19
  • OK. What did you try? What is not working? – VonC Sep 18 '17 at 16:20
  • I want to do it via cmd...i am trying to automate applying baselines for fixes which we generates from stream.... – A.Learn Sep 18 '17 at 16:23
  • I wasn't able to find cleartool command via which i could fetch and apply the baseline – A.Learn Sep 18 '17 at 16:24
  • So maybe you need a way to get the latest most recent baseline? Can you detail your question? – VonC Sep 18 '17 at 16:24
  • @VonC i went on the stack overflow question which mentioned but it didn't help although i haven't seen the ibm deliver command link...it seems it contains a command to deliver the baseline from one stream to another....thanks for that...i'll try it out tomorrow and will update in case i'll be able to come up with the command – A.Learn Sep 18 '17 at 16:42

1 Answers1

1

A deliver (intra or inter-project, which might need the right policy to be enabled first) needs to use the cleartool deliver command.

You need an UCM view on the destination stream (the stream to which you are delivering)

And you need the latest foundation baseline produced on the source stream (otherwise, it would deliver by default all activities in the stream that have changed since the last deliver operation from the stream).
That also means you know which UCM component you want to deliver.

See "List the latest baseline of a component in a UCM stream one by one".
For a given component:

bl=cleartool lsbl -comp C -stream stream:aSourceStream@/aPVob|tail -1
cleartool deliver -baseline ${bl}@/apvob -to aViewOnDestinationStream@/apvob

Or, as commented by the OP A.Learn, you can use for delivery the recommended baseline of the source stream:

$baselines = "cleartool desc -fmt \"%[rec_bls]CXp\" stream:".$productStream."\@\\".$pvob 
//Below command applies the baseline 
cleartool rebase -f -baseline ".$baselines." -complete
//Finally recommend the new baselines 
cleartool chstream -recommended -default stream:".$StreamName."\@\\".$pvob 

This is using the fmt_ccase format applied to cleartool describe.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • It works.... From description of your answer i was able to come up with another way to achieve my goal. // Get recommended baslines which need to be applied on new stream $baselines = "cleartool desc -fmt \"%[rec_bls]CXp\" stream:".$productStream."\@\\".$pvob //Below command applies the baseline "cleartool rebase -f -baseline ".$baselines." -complete" //Finally recommend the new baselines "cleartool chstream -recommended -default stream:".$StreamName."\@\\".$pvob – A.Learn Sep 19 '17 at 10:54
  • @A.Learn That will work too, well done. I have included your comment in the answer for more visibility. – VonC Sep 19 '17 at 10:56
  • updated my comment for complete answer...Sorry for trouble – A.Learn Sep 19 '17 at 10:58
  • @A.Learn No problem. I have amended the answer accordingly. – VonC Sep 19 '17 at 11:00