Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using intellij idea merge as default merge tool in hg

So, i've found this page here, showing how to use intellij's idea merge and diff from command line, and i'm trying to set it as a default for hg. However, i still have some problems when merging branches (many files):

  • If hg merge is called while there's no idea instance running, it starts a new instance, show the diff, wait for my response (click on apply / abort). After that, it proceeds to the next file, and do the same. File by file. Works pretty well, but is also veery slow (since it needs to start a new instance every time). Also, as said, there must be no idea instance running, to do that.
  • If hg merge is called while an idea instance is running, it shows the first diff window, but at the same time starts to merge all other files... This end up in a lot of pop-ups of "file not found" on idea, pointing to tmp files (of .other and .original).
    Does anybody know how to do that in a usable way? hg merge using idea merge as default ?
    Here's my .hgrc file:
    [ui] merge=idea [merge-tools] idea = idea.gui = True idea.args = merge $local $base $other $output idea.priority = 1000 idea.premerge = False Sorry for the bad english, and thanks to all in advance
like image 786
Rodrigo Silva Avatar asked Jun 16 '16 21:06

Rodrigo Silva


People also ask

How do I merge windows in IntelliJ?

As of IntelliJ IDEA version 14.1, combining multiple floating toolwindows into one toolwindow with multiple tabs is still a feature that does not exist. Floating editor windows can be combined into a single window by drag&drop.


2 Answers

Hi here are the settings I used successfully.

[ui]
merge=idea

[merge-tools]
idea.args = merge $local $other $base $output

Also ensure that idea is on the path.

My references are the mercurial MergeToolConfiguration and Merging files using IntelliJ IDEA as a command line tool.

like image 69
Joe Lawson Avatar answered Nov 15 '22 08:11

Joe Lawson


Idea does not wait, but gives return too early. A good way to solve this problem is to get mercurial to prompt you.

By setting this configuration in the .hgrc

idea.check = prompt

Mercurial will ask for confirmation on each file. You must finish the merge in Idea before clicking "Yes" on the confirmation box.

like image 32
Jan Sverre Avatar answered Nov 15 '22 10:11

Jan Sverre