2

I need help in knowing how to get the details of when a particular contributing activity is delivered to integration stream.
I used to use diffbl -activity baseline1 baseline2 in cleartool to get the list of activities made from one baseline to another baseline.

Now the new need is that i need to get the date time of when some of the activities listed as an output of diffbl are delivered.
I tried using lsact, describe but i am getting the "Activity not found" error.
Probably because the activity I am querying at is a contributing activity.

Could somebody know how to get the date time of when a contributing activity is delivered or how to customize the output of "diffbl -activity baseline1 baseline2" to get the activity date time details as well?.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
Lax
  • 21
  • 1

1 Answers1

0

When I look at the cleartool diffbl man page, I don't see any formatting option.

That means you need to parse the result of that command, feeding each activity to a cleartool describe -fmt, using one of the fmt_ccase option to display what you want.

This thread gives you an idea of the process to follow, but it is in bash (unix), to be adapted for windows if you need it:

for act in $(ct diffbl -act bl1@/vobs/apvob bl2@/vobs/apvob | grep ">>" | grep -v "deliver." | cut -f2 -d " "); do echo "Activity: $act"; cleartool desc -fmt "%d\n" activity:$act; echo; done

In multiple line for readibility:

for act in $(ct diffbl -act bl1@/vobs/apvob bl2@/vobs/apvob 
  | grep ">>" 
  | grep -v "deliver." 
  | cut -f2 -d " "); 
  do 
    echo "Activity: $act"; cleartool desc -fmt "%d\n" activity:$act; echo; 
  done

Note that by excluding "deliver." activities, we are focusing only on contributing activities, as explained in "How to find files asssociated with a ClearCase UCM activity?".


The OP Lax reports having successfully managed to extract the names of the activities, with a:

desc -fmt "%Nd\n" "activity:myActivityId" 

(@\pvob being already part of the result of the diffbl command. Lax is just parsing the activityid from the diffbl results and putting it to desc command)

He adds:

I am needing this in the context of C#, so parsing is just like parsing any other string: I am using a regex to seperate the output to my interested activities. ex:

Regex.Matches(diffBlOutput, "myInterestedPattern"); 

And for each match in regex result, I get the activity with

RegexMatch.Groups["activity"].ToString()

activityid is actually a substring of this string as the result is always "activtyid activityName" so, substring(0,result.indexOf(' ')); gets me the activity id.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thanks for the reply, I read your help and tried out the below option in cleartool which didn’t work. Could you kindly let me know, if I am making any mistake. Step1:- Command:- cleartool> diffbl -activities 33.2.534.8111@\MYProject_PVOB 33.2.754.7570@\ MYProject _PVOB Output:_ Comparing the following: 33.2.534.8111@\MYProject_PVOB 33.2.754.7570@\MYProject _PVOB Differences: >> deliver.abcde_MYPACKAGE.20111116.152232@\cde_Components "deliver abc de_MYPACKAGE on 16.11.2011 15:22:32." >> Bugfix_ABCDClient@\CDE_Components "Bugfix ABCD Client" {Continued in next comment} – Lax May 18 '12 at 10:09
  • Step2:- Then I tried the following to get the activity details of the "Bugfix ABCDClient" Try 1:- cleartool> desc -fmt "%d\n" " Bugfix_ABCDClient@\CDE_Components @\MYProject _PVOB" cleartool: Error: Unable to access " Bugfix_ABCDClient@\CDE_Components @\ MYProject _PVOB ": No such file or directory. Try2:- cleartool> desc -fmt "%d\n" " Bugfix_ABCDClient@\CDE_Components" cleartool: Error: Unable to access " Bugfix_ABCDClient@\CDE_Components" : No such file or directory. Could you let me know, if I am making any mistake?. – Lax May 18 '12 at 10:09
  • @user1402644 two comments: 1/ a describe of a specific object (like an activity) requires the **fully qualified name**: `activity:anActivity@\apvob`. 2/ If '`MyProject_PVob` is the pvob which contains your components, Streams, projects and activities, then the describe should refer to `activity:deliver.abcde_MYPACKAGE.20111116.152232@\MyProject_PVob`. But if `CDE_Components` is *also* a pvob, then yes, the fully qualified name would be `activity:deliver.abcde_MYPACKAGE.20111116.152232@\CDE_Components` – VonC May 18 '12 at 10:21
  • Thanks for the help, That does my job. I cant vote up because of the 15 point restriction :) . But, A big thumbs up !!! – Lax May 18 '12 at 12:11
  • @Lax: glad to help. Could you post in the comment the final commands you used? I will add them to the answer. – VonC May 18 '12 at 12:13
  • This is the command i used: desc -fmt "%Nd\n" "activity:myActivityId" – Lax May 18 '12 at 13:02
  • @Lax: did you combined it with some kind of grep like in my answer? And did you need the `@\pvob` after your `myActivityId`? – VonC May 18 '12 at 13:04
  • :No, @\pvob already part of the result of the diffbl command.So, I am just parsing the activityid from the diffbl results and putting it to desc . – Lax May 20 '12 at 15:29
  • @Lax: excellent. Can you share, in your context, what command did you use to parse the `diffbl` result? – VonC May 20 '12 at 16:15
  • I am needing this in the context of C#, So, parsing is just like parsing any other string, i am using a regex to seperate the output to my interested activities . ex:Regex.Matches(diffBlOutput, "myInterestedPattern"); and for each match in regex result, I get the activity with RegexMatch.Groups["activity"].ToString(), activityid is actually a substring of this string as the result is always "activtyid activityName" so, substring(0,result.indexOf(' ')); gets me the activity id. – Lax May 21 '12 at 05:35
  • @Lax: Perfect, thank you for this feedback. I have included it in my answer for more visibility. – VonC May 21 '12 at 05:54
  • I just realized that the output of desc -fmt "%d\n" "Activty:MyActivity" is the creation date of the activity. Not the timestamp of when that activity is delivered to the integration stream. Is there a way to find out the delivery timestamp of the contributing activity?. or do i have to do the hard way of maintaining the list of contributing activites for each delivery activity and check in whether my activity is part of that delivery activity if not search in the next delivery activity like that?? – Lax May 21 '12 at 09:24
  • @Lax I am afraid your second option is the right one: the date of the `deliver.xxx` activity is the one recording all the delivers made by the contributing activities to said deliver. The contributed activities themselves should have no clue (except maybe by some obscure UCM hyperlink, but that not documented) – VonC May 21 '12 at 09:28
  • Hmm .. Thanks for that information . I will check out the performance with a solution of that sort.. For each interested activity, Get the corresponding delivery activity and its creation timestamp. – Lax May 21 '12 at 11:07