Question

I have a problem here with the branch per task strategy in clearcase.
We are using snapshot views. We have various task branches and an integration branch.
So, we merge the branches to integration for testing.

Now, suppose I am working on a file on BR1 which is merged to integration branch and this file refers to another file which is not merged to integration branch but BR2 for the second file is merged to integration branch.

So, second file is pointing to the BR2 edition of the file whereas I didn't want those changes but since I am taking all other code from integration branch, its taking that version.

This is my config spec:

element * CHECKEDOUT
element * .../BR1/LATEST
element * .../integration/LATEST -mkbranch BR1
element * /main/LATEST -mkbranch integration
element * /main/0 -mkbranch integration

Is there any way to resolve? One way I could think of is putting a label so ,change the config spec to pick from that label and not from latest of integration branch but that would need changing the labels as the work gets progressed in the task branches.is there any other way we could do this?

Was it helpful?

Solution

The integration branch is there to integrate, so if you are doing work from that branch, I would really advise you to take all those files.

If the issue is only for one file, you simply can try a "cherry-pick" approach, and checkout that file in your current BR1 branch, replacing its content with any other version you want (with a cleartool get, for instance, as detailed in "Clearcase command to export an element").

Considering your config spec, I would recommend:

  • putting a label 'L_BR1' just after merging BR1 to Integration,
  • select that label over the LATEST of Integration (which contains version merged from BR2)

That would mean a config spec like:

element * CHECKEDOUT
element * .../BR1/LATEST
element * .../integration/L_BR1 -mkbranch BR1    <=== add this select rule
element * .../integration/LATEST -mkbranch BR1
element * /main/LATEST -mkbranch integration
element * /main/0 -mkbranch integration

Caveat: be ware, though, that it wouldn't work well on cross-integrations (when you merge BR1 to Integration, then BR2, then again BR1)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top