Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3945972
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T01:04:41+00:00 2026-05-20T01:04:41+00:00

All: I want to use kdiff to merge all files with a certain suffix

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T01:04:42+00:00Added an answer on May 20, 2026 at 1:04 am

    Merge tools can use any executable file. To set up a merge tool which always overwrites $base with $other, you can use the following:

    [merge-tools]
    clobbermerge.priority = 100
    clobbermerge.premerge = False
    clobbermerge.args = $other $output
    clobbermerge.executable = <copy executable>
    

    When using this strategy on Windows, there is one problem. You cannot simply replace <copy executable> with the copy shell command. For some reason, Mercurial fails to find shell commands in this context. I have not tried this on *nix.

    To work around this problem, you can create a distribute a batch file that performs the copy. It simply needs to run: copy %1 %2. Once placed on your PATH, you can set clobbermerge.executable=clobber.bat.

    If you have kdiff3 installed (comes with TortoiseHg on Windows), you can get the same results without the external batch file using a configuration like this:

    [merge-tools]
    clobbermerge.priority = 100
    clobbermerge.premerge = False
    clobbermerge.args = --auto $base $other $other -o $output
    clobbermerge.executable = kdiff3
    

    The key to this configuration is the args field:

    • --auto: tells kdiff3 not to open the GUI if there are no conflicts
    • $base $other $other: tells kdiff3 to only use $other
    • $output: tells kdiff3 the name of the output file
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want all CSV files in a directory, so I use glob('my/dir/*.CSV') This however
Below is my stored procedure. I want use stored procedure select all row of
I want to use all the photos in a Flickr set and in order
I want all my pages to use have some viewdata. i need to get
I want to use javascript to change all of the <option> tags to <a>
I want to use google guice to make properties available in all classes of
Greetings to all... I want to use fade effect with jCarouselLite qualities. Is it
First of all, I don't want to use a join because that will make
What's the minimum JavaScript I need if all I want to do is use
Hay guys, i want to use something like this users = User.objects.all() but i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.