4

I have two integration branch int_1 and int_2.
In the time there has always been merged from int_1 to int_2.

I want to know when was the last time a merge was done on int_2 branch from int_1 branch.
Is there any command to do that?

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
skm_satish
  • 445
  • 4
  • 12

2 Answers2

0

If you are talking about UCM integration branches, that means you have done delivered from one integration Stream of one UCM project to another integration Stream of another project.

In that case, go to the destination branch int_2, and look for deliver.xxx activities. The most recent one will tell you when the last deliver was done.

With base ClearCase, this isn't so straightforward.
You need to list the last version of int_2, describing them in order to look for a merge hyperlink.
See "How files and directories are merged"

merge

Here you would see, going back from the most recent to the oldest version of test, that the last merge from main was on version 3.
Describing that version would return:

cleartool describe util.h@@/main/3version "util.h@@/main/3"
.
.
.
Hyperlinks:
Merge@278@/vob_3 /vob_3/src/util.h@@/main/rel2_bugfix/1
-> /vob_3/src/util.h@@/main/3

You can also try:

cleartool describe -l util.h@@/main/3version
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • @user2210807 ok, I have edited the answer to cover base ClearCase. – VonC Mar 26 '13 at 09:20
  • Thank you VonC for the quick reply. For a particular file that is fine. But here if i have say 100 files with int_2 branch. And 50 files were merged in 1st merge from int_1, then say 30 files were merged in 2nd attempt and 10 in 3rd merge and rest 10 in fourth merge. So i have complete list of files having this branch int_2, but checking on each file is a bit difficult. i need to know here the fourth merge info which just have 10 files. And the date time when this merge was done. – skm_satish Mar 26 '13 at 09:37
  • @user2210807 I understand: you need to script the lookup process for each version of `int_2`, in order to collect the date of each most recent hyperlink, building back the 4 sets of merges. That is why UCM is much more convenient, adding "activities" in order to record precisely those successive merges. – VonC Mar 26 '13 at 09:39
  • @user2210807 but the short answer is: I don't know of a native `cleartool` command that would do that for you. – VonC Mar 26 '13 at 09:40
0

Strictly speaking, your question has no answer because ClearCase doesn't have changesets or any feature that would represent a single "merge". All you can do is search for merges that occurred between singular file-versions, and see what time each was performed. If they were on the same day, or very close to each other in time, they probably represent one "merge".

For a motivating example to start with look at the manual via "cleartool man find", which lists some examples of using the merge(from-branch, to-branch) clause.

To get the versions int_1 that were merged to int_2, try:

ct find . -type f -branch 'brtype(int_1)' -version 'merge(/main/int_1,/main/int_2) && hltype(Merge,->)'

To see the target versions, add some additional processing, e.g.:

ct find . -type f -branch 'brtype(int_1)' -version 'merge(/main/int_1,/main/int_2) && hltype(Merge,->)' -exec 'echo -n "$CLEARCASE_XPN " && cleartool desc -short -ahlink Merge $CLEARCASE_XPN'

To find out what time the merge occurred, you'll need to do some post-processing of the target version (e.g. cleartool desc -fmt '%Nd' ) to get the timestamp.

Garen
  • 941
  • 2
  • 9
  • 20