Using intellij idea merge as default merge tool in hg
Asked Answered
D

3

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
Dedicate answered 16/6, 2016 at 21:35 Comment(0)
S
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.

Selfpropelled answered 12/9, 2016 at 16:0 Comment(0)
W
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.

Whichsoever answered 11/4, 2019 at 17:32 Comment(2)
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.Whichsoever
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! :))Winstead
L
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.

Lodestone answered 6/2 at 4:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.