views:

167

answers:

4

I'm currently using TortoiseSVN to do a merge of two branches and I've found that its not smart enough to handle a specific merging senario.

In one branch I have a method as follows:

MyMethod(parameter1, parameter2, parameter3)

In the other branch I have the same method as follows:

MyMethod(parameter1, parameter2, parameter4)

TortoiseMerge notices that there is a conflict but only gives me the option of using one method signature or the other. However, what I really want is to merge it into a single method with all four parameters as follows:

MyMethod(parameter1, parameter2, parameter3, parameter4)

The only way I can get around this conflict at the moment is to resolve the line so that both methods are present and then manually go to the file and correct it after the conflict has been resolved.

Is this just the way things are or is there a smarter merge tool out there somewhere that would be able to handle this scenario?

A: 

Araxis Merge is popular for its power. Personally I like SourceGear DiffMerge since its more free'er.

popester
+1  A: 

I don't get it? Your project won't compile, or worse, won't run correctly after the merge because the method signature you want is not in either branch. Isn't this more dangerous than a conflict? Perhaps I've missed something obvious.

IMHO TortoiseSVN (or rather the SVN client) is doing the right thing in reporting a conflict, it needs human intervention.

Si
yes, I agree it needs human intervention...I'm just wanting a tool that allows me to merge the code correctly instead of having to resolve it incorrectly and then fix it manually afterward.
mezoid
Agreed...if the same line of code is different in each file then there is no way that svn can figure out how to merge them. Even humans may have difficulty merging those lines if they don't know the purpose of the methods.
Vincent Ramdhanie
A: 

AFAIK, No merge tool can help in these scenarios except reporting it as conflict

You want the tool to merge it into a single function call with all 4 parameters.

MyMethod(parameter1, parameter2, parameter3, parameter4)

Here also comes the ambiguity whether to place the parameter3 first and then parameter 4 or the vice-versa.

Naga Kiran
A: 

So far I haven't found any tool that does what I'm asking for automatically. It may not even be possible. But I have found a workaround which I thought I'd report on.

I ended up installing perforce visual merge which I've found has a nicer merge facility than the default provided by tortoise svn. One of the nice features I've found, which I can't remember if tortoise merge had, is that it allows one to see and edit the merged result. So even though it can't automatically merge the line I want, I am able to edit the conflict in situ instead of resolving it incorrectly and manually updating it after the merge.

mezoid