1

I am having a major issue with clearcase merge:

I have a list of files taken from clearcase long time back and updated outside clearcase. In between, the same files have changed in clearcase as well. Now, I created a new branch and checked in the updated code from outside in the new branch.

But when I want to merge from new branch to integration branch, it automatically merges and overwrites the changes in integration branch with the changes from new branch. What I would have expected it to atleast raise a conflict and not wipe out the changes made in clearcase integration branch.

can anyone help here please?

user2636464
  • 685
  • 7
  • 17

1 Answers1

1

You need to be careful from which version you are starting your new branch.

If you are starting a new branch from the LATESt version of the current branch, in order to:

  • clearfsimport your code modified outside of ClearCase
  • merge said new branch to your current branch

Then, yes, all changes will overwrite the current versions.

But if you make your branch from an older version (a previous label or UCM baseline), import your code there and merge, then the merge will work or generate conflict if appropriate.

In other words, you need to start your branch from what you estimate is a common ancestor for your merge to work.
See "Rebasing and merging in ClearCase":

ClearCase merge.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • thanks. But thats the problem I dont know when this code was taken from clearcase and updated so i dont know the common ancestor. But is this a common thing with clearcase? I am still not able to understand how it works and overwrites the code instead of raising an issue? – user2636464 Dec 13 '13 at 11:46
  • @user2636464 you must find a version of your current code which you believe could be a common ancestor. If you merge `C2` while `C2` is done on top of `C1` (meaning `B` equals `C1`, that is: `C1` -- the destination -- is also the base, or common ancestor), then a merge from `C2` to `C1` will simply overwrite `C1`. – VonC Dec 13 '13 at 12:00
  • @user2636464 by the way, I see you asked ClearCase questions before. Did you read http://stackoverflow.com/tour and http://stackoverflow.com/help/accepted-answer? – VonC Dec 13 '13 at 12:03