0

Is it possible to control how merge tools recognise similar blocks of code? Particularly meld, but any suggestions of alternative tools also welcome. If it is relevant, I am using mercurial.

I am working on a system which has a code generator generating initial get/set functions and a fairly common situation is two developers have each added a field, and the new get/set functions are generated at the end of the library. When it comes to merging, there is an inevitable merge conflict.

What I would like is for the merge tool to recognise these as separate functions, rather than modified versions of the same function.

Meld at least starts off with a nice enough view, showing the functions added to each version:

Initial merge state

Unfortunately, after I pull across the first it, it now thinks the functions have been modified on one system, instead of seeing them as two separate functions. This is also the same merge result as I see initially in KDiff3:

Not what I want!

asc99c
  • 3,815
  • 3
  • 31
  • 54

1 Answers1

0

With KDiff3 you can place manual sync marks to force it to consider lines to be equal. See this answer for example and screen shots.

Community
  • 1
  • 1
hlovdal
  • 26,565
  • 10
  • 94
  • 165