1

Is there any command in which I provide a baseline name plus an element filename, and it returns the exact file version that is labeled by this baseline?

For instance:

baseline name: 7.5.3.1
element filename: a.java

Result:

/main/mystream/16

My question refers to UCM, where you can't move a baseline between versions...

If there's no such command, it seems I have to write a short script. In that case, I probably have to run cleartool lsvtree and then parsing the output - am I right? Is that the most rapid way?

Thank you

Tamir Gefen
  • 1,128
  • 2
  • 18
  • 35

1 Answers1

1

You could query the exact version by looking at the label on the version of that file.
But that would only work if the baseline is a full baseline (meaning it has set a label named after the baseline on each file part of the component associated with said baseline).
See "What is the difference between Full baseline and Incremental baseline in Clearcase UCM?".

If that is the case, then you can look to the exact version with a cleartool find command, like in "How to search files by label".
Other mechanisms are described in the IBM technote "How to determine which element version a label was moved from".

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thank you. How are you looking at the label on the version of that file? We sometimes use incremental baselines. Is there a way that covers all baseline kinds? – Tamir Gefen Sep 14 '12 at 08:58
  • @user986086 simply upgrade your baseline: you can promote an incremental baseline to a full one at any time. – VonC Sep 14 '12 at 08:59
  • I tried this: cleartool find -all -element "{lbtype_sub(REL1)}" -print but it returns a list of all file elements in that REL1 baseline. How to change that command for a specific filename and also include the specific version? – Tamir Gefen Sep 14 '12 at 09:31
  • What if I can't upgrade the incremental baseline? Should I use the same 'cleartool find' command? – Tamir Gefen Sep 14 '12 at 09:32
  • @user986086 For the specific version part, your `cleartool find` query need to be more specific: no `-all`, and use `-version`, not `-element`: `cleartool find /path/to/your/files -version "{lbtype_sub(BASELINENAME)}" -print` – VonC Sep 14 '12 at 09:47
  • @user986086 there is no reason you shouldn't be able to upgrade a baseline though. – VonC Sep 14 '12 at 09:48
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/16684/discussion-between-user986086-and-vonc) – Tamir Gefen Sep 14 '12 at 09:52
  • What if I can't upgrade the incremental baseline? Should I use the same 'cleartool find' command? – Tamir Gefen Sep 14 '12 at 11:29
  • @user986086 yes, but that will return only the versions which have changed since the last baseline. For the other versions, you would need to go back in the history of baselines and look what version of those other files (the ones not labelled by your incremental baseline) is part of those previous baselines: it becomes quite cumbersome. – VonC Sep 14 '12 at 11:34