Mercurial merge strategy per file type

Posted by dls on Stack Overflow See other posts from Stack Overflow or by dls
Published on 2011-02-10T21:17:44Z Indexed on 2011/02/11 15:25 UTC
Read the original article Hit count: 246

Filed under:
|

All:

I want to use kdiff to merge all files with a certain suffix (say *.c, *.h) and I want to do two things (turn off premerge and use internal:other) for all files with another suffix (say *.mdl). The purpose of this is to allow me to employ a type of 'clobber merge' for a specific file type (ie: un-mergable files like configurations, auto-generated C, models, etc..)

In my .hgrc I've tried:

[merge-tools]
kdiff3=
clobbermerge=internal:other
clobbermerge.premerge = False

[merge-patterns]
**.c = kdiff3
**.h = kdiff3
**.mdl = clobbermerge

but it still triggers kdiff3 for all files. Thoughts?

An extension of this would be to perform a 'clobber merge' on a directory - but once the syntax is clear for a file suffix, the dir should be easy.

© Stack Overflow or respective owner

Related posts about mercurial

Related posts about merge