tags:

views:

144

answers:

1

Hi,

I have a peculiar Clearcase doubt. I cannot fully describe why I'm doing such a confusing architecture, but I need to do it (thanks to the mistake done by someone long back).

Ok, here's a bit of detail: B1 is a contaminated branch where both my group's changes and another group's changes got mixed together so badly that there is no way of finding which code is whose). So the solution proposed is to create a new branch called B2 (at the same level as B1) and put all the unmodified code of the other group on it (The way to do that would be to merge B1 with B2 and then go about removing all changes from it till it becomes original). Then create a CR branch on B1 and keep only my group's newly added files or modified files on that branch. Finally create an integration branch out of B2 and merge the changes from CR branch of B1 to integration branch of B2.

So here is what I did: (The use case is where I have dir D where file a, b and c are there. My group ended up modifying file a while b and c are not modified at all).

There is a branch B1 on which there are files a, b and c. There is another branch B2. A merge is done from B1 to B2. Now B2 also has a, b and c.

At this point both branch B1 and B2 are same. Now I delete file a from branch B2 (rmname). Now B2 has b and c only. I put a label to this branch called Label1. This makes the code with label Label1 as the unmodified code from other group.

Now I create a sub branch called CR1 from B1 and delete all the files that are there in B2 branch (i.e b and c) such that it contains only the modified code from original code on it. In my case it is file a.

At this point branch B2 with label Label1 has files b and c (those are unmodified code) and branch CR1 coming off B1 has only a (that is modified by us).

Now I create another branch called integration branch that comes off B2 Label1. And then I do a merge of CR branch on to that expecting that it will have all three files a, b and c for me. All I'd need to do is to do a version tree view and see who modified what.

But the problem I face is that since I had done a rmname of file a on branch B2 earlier to putting Label. The merge does not really take the file a from CR branch.

How to I get around that problem. I want to selectively merge. Is it possible?

sorry if it is a bad design. I'm not really conversant with Clear case and have limited options and time to clear some one else's mess.

+1  A: 

(tongue in cheek)
In one of those situations, I actually create a git workspace within my ClearCase view, untangle the situation in Git branches, before clearfsimporting back the result!

More to the point:

:

      CR1----------------------------(a)
      .  (C1 branch from B1)           \  (a merged to Int)  
     .                                  \ 
B1-(abc)                               Int (b,c)  # where is a???
     .                                  . 
       .  (B2 branch from B1)          .  (Int branch from B2)
      B2-(abc)-----------------------(bc,label1)

A merge from CR1 won't add a back, because:

  • the common ancestor of A (on B1) has been part of B2, before being deleted on B2
  • Int comes from B2
  • a is not considered for merge to a branch coming from B2 since it was already part of B2.

In this instance, I would recommend a graphical merge of the directory, which would allow you to manually solve that merge (forcing the resolution to be: "take a")

VonC
Hi Vonc,Many thanks for your reply. I also found out that other than doing the merge graphically there seems to be not a better way.Thanks a lot.Keshav
Keshav