1

I'm using windows. I need to extract activity ids of check ins in ClearCase.

I can get the current one through cleartool describe and then parsing the response for the word 'Activity'.

I'm looking to get the activity ids of it's previous versions.
How can I do that?

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
Ramdas Nair
  • 278
  • 1
  • 3
  • 10

1 Answers1

1

You don't have to parse the output of cleartool describe, if you combine it with fmt_ccase.

That allows you to:

  • get the previous version of an existing version

     cd /path/to/view
     cleartool describe -fmt "%[version_predecessor]p" afile
    
  • get all activity id with that version involved:

     cd /path/to/view
     cleartool describe -fmt "%[activity]p" afile@@/a/previous/version
    

(that is using the version-extended pathname @@/... returned by the first cleartool describe)

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thanks. I'm getting an object selector required error for the first command. Am I missing anything? – Ramdas Nair Jun 27 '16 at 06:17
  • @RamdasNair What do you type? What is your ClearCase version? – VonC Jun 27 '16 at 06:31
  • sorry, that was my bad. Accidentally messed up the syntax. Both seems to work just fine and makes sense instead of just parsing the entire describe output. :) – Ramdas Nair Jun 27 '16 at 06:49
  • @RamdasNair Great! Can you add a comment with the exact syntax you used? – VonC Jun 27 '16 at 06:54
  • Sorry, I missed this one. Here it is: cleartool describe -fmt "%[version_predecessor]p afile Didn't close the double quote. :/ – Ramdas Nair Jul 03 '16 at 18:10