I am attempting to merge a small amount of code changes from a branched file to a trunk file that has been heavily modified (mostly by adding cases to a switch). When I am attempting to merge the code, I am merging from the older file to the newer file (from less cases to more cases). When I tell visual studio to merge from the branch to the trunk, it is getting rid of all of the updated (new) cases and replacing the last (new) case with the case that was added in the branch. EX:
TRUNK:
SWITCH(var){
CASE(123)
thing = "bnm"
BREAK
CASE(124)
thing = "gjh"
BREAK
CASE(125)
thing = "sdf"
BREAK
CASE(126)
thing = "asd"
BREAK
CASE(127)
thing = "qwe"
BREAK
}
BRANCH:
SWITCH(var){
CASE(123)
thing = "bnm"
BREAK
CASE(124)
thing = "gjh"
BREAK
CASE(325)
thing = "poi"
BREAK
}
MERGE RESULT:
SWITCH(var){
CASE(123)
thing = "bnm"
BREAK
CASE(124)
thing = "gjh"
BREAK
CASE(325)
thing = "poi"
BREAK
}
DESIRED RESULT:
SWITCH(var){
CASE(123)
thing = "bnm"
BREAK
CASE(124)
thing = "gjh"
BREAK
CASE(125)
thing = "sdf"
BREAK
CASE(126)
thing = "asd"
BREAK
CASE(127)
thing = "qwe"
BREAK
CASE(325)
thing = "poi"
BREAK
}
What I want to happen is for it to isolate the new case and move it into the switch. I was hoping there is a way to manually decide how to merge the files or a way to "teach" the merging tool how to handle large changes.
In the example, the only things that differ from case to case are the values within the case (CASE(value)
) and the value assigned to thing
. Also, there are never any merge conflicts detected.
If there is no way to fine tune the compare tool, are there any other tools that are great at automerging?
UPDATE: This is only an issue when you do a baseless merge. If you do not do a baseless merge, it works fine