Three-way merge for hg using vim

I accidentally blew away my .hgrc and it took me some time to recover my 3-way merge inspired by Dan McGee’s article on the subject. So for my and your future reference here’s what you need in your .hgrc to get hg merge to give you a three merge window in vim:

[ui]
merge = vimdiff

[merge-tools]
vimdiff.executable = vim
vimdiff.args = -f -d -c "wincmd J" "$output" "$local" "$base" "$other"

When running hg merge, the effect you get is best described by Dan McGee himself:

The end result is three panes along the top (local, base, and remote respectively), and the merge work-in-progress is on the bottom. In addition, all four panes are still locked together for scrolling.

2 Comments

  1. doubleface says:

    Did you try treesome.vim ? http://sjl.bitbucket.org/threesome.vim/.

  2. anonymous_penguin says:

    you should have used vcs on your home, so you could have recovered the previous .hgrc easily :P