configurationmercurialmacosfilemerge

Configuring Mercurial - FileMerge for Apple Mac OS X


How do I configure Apple's FileMerge program to function as Mercurial's merge tool? I have my .hgrc file setup in my home directory and I simply want to configure FileMerge as the merge program.


Solution

  • As described in the hg wiki, this has worked for me with various versions of hg:

    $ vim /usr/local/bin/opendiff-w
    
    #!/bin/sh
    # opendiff returns immediately, without waiting for FileMerge to exit.
    # Piping the output makes opendiff wait for FileMerge.
    opendiff "$@" | cat
    
    [extdiff]
    cmd.interdiff = hg-interdiff
    cmd.opendiff = opendiff-w
    
    [merge-tools]
    filemerge.executable = opendiff-w
    filemerge.args = $local $other -ancestor $base -merge $output
    
    [extensions]
    extdiff = 
    

    Now you can use it as $hg opendiff.