kdiff3 arguments order

Brad Wetmore Bradford.Wetmore at Sun.COM
Mon Dec 3 20:31:01 UTC 2007



Yuri Nesterenko wrote:
> Colleagues,
> 
> moderately useful dry-run finding:
> using kdiff3 as a merge tool for mercurial, you better wrap it in the script
> like this ("merge = ~/bin/kdiff3.sh" in my .hgrc):
> 
> #!/bin/bash
> /opt/kde3/bin/kdiff3 -o $1 $2 $1 $3 

I like kdiff3 too, but doesn't work under default Solaris.  Apparently 
have to build/install KDE.  I currently use it only under Windows.

Anyway, the default hgmerge script in the hg distribution does do this 
automatically.

     http://selenic.com/repo/hg-stable/file/f2f42262adbd/hgmerge

     # try using kdiff3, which is fairly nice
     if [ -n "$KDIFF3" ]; then
         #
         # Auto Merging is evil!!!  Brad
         # $KDIFF3 --auto "$BASE" "$BACKUP" "$OTHER" -o "$LOCAL" \
         #    || failure
         #
         $KDIFF3 "$BASE" "$BACKUP" "$OTHER" -o "$LOCAL" || failure
         success
     fi

Having been a teamware user for years, I think automerging is evil, so I 
don't use the default --auto option.

Note:  the standard windows distributions don't include the hgmerge 
/bin/sh shell script, probably because windows doesn't have a Bourne 
shell by default.  I run MKS under Windows, so I copied/use the default 
hgmerge from the mercurial source base.  You'll probably need to install 
it as:  c:/Mercurial/hgmerge.sh  (or wherever you installed Mercurial), 
otherwise, Mercurial may expect the hgmerge file to be a COMMAND.COM 
(DOS) script.

Brad



More information about the build-dev mailing list