6

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

3 Answers 3

4

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.

2

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.

2
  • 1
    I know this is an old question, but it was the only result at Google, so I decided to leave an answer for later visitors.
    – Jan Sverre
    Commented Apr 11, 2019 at 17:32
  • Not sure from where you got this, but this really made my day after struggling with Merge error: "Error showing merge: Can't find file:" for hours because of that "return too early" thingy. Thank you, mate, thank you! :)) Commented Jun 27, 2019 at 21:26
0

I'm not sure if it's an IntelliJ or Mercurial change, but the answer about using:

idea.check = prompt

does not seem to work anymore. On opening, IntelliJ tells me it can't find one of the files in /var/folders/nd/xxxxx.

This "check" element is not even present in the doc as of writing.

I was not yet able to verify any workaround, as I need to encounter another merge conflict to verify that, but modifying the idea script to force user input before exiting could be a way.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.