Issue #81 resolved

Merge - When select manual resolve button, still appears to do auto

Mike Wilkes
created an issue

I would have expected the Manual Resolve button on the resolve dialog to immediately launch my merge tool. This does not happen. It appears to do an auto merge regardless of which of Auto or Manual I select.

Is this a mis-understanding of usage on my part, or a bug?

Comments (11)

  1. Steve Borho

    It depends a great deal on your preferred merge tool.

    If it's kdiff3, the default arguments for it include --auto which tells it to go ahead and merge without opening the GUI if there are no conflicts.

  2. Mike Wilkes reporter

    I wondered if that was the case... I use BeyondCompare, but also tried kdiff, thinking it might react differently.

    For clarification, if I choose auto, THG is using it's/mercurials merge tool, and if no conflicts reported, it continues. If a conflict is found, it will start the defined merge tool.

    If manual is chosen, it goes straight to the merge tool. If the merge tool is defined to do some auto merging, obviously that is beyond the control of THG.

    Bottom-line. Sounds like user issues rather than tool issues. Also, I really like the new merge tool. Even after an auto-merge, I can still review a files changes from the bottom 'resolved' area.

    I'll do a little more experimentation, and if it appears to be config issues, I'll mark this as invalid. For now, I'll put it on hold.

  3. Steve Borho

    Very specifically, when you click the 'Auto Resolve' button the dialog runs 'hg resolve --tool=internal:merge [FILES]' which tells Mercurial to use its built-in three way merge utility. If conflicts are found, the file is left unresolved and conflict markers are left in place. If no conflicts are found the file is marked resolved.

    When you click 'Manual Resolve', the dialog runs 'hg resolve [FILES]' without any --tool override, meaning it will run your preferred merge tool unless a file pattern specifies a different one.

    My inclination is the button names are not that great, but it's not simple to summarize Mercurial's merge behavior in two button names. Suggestions welcome.

  4. Johan Samyn

    How about:

    'Auto Resolve' --> 'Mercurial Merge'

    'Manual Resolve' --> 'Kdiff3 Merge' or 'BeyondCompare Merge' or ...

    Because external tools like BeyondCompare and Kdiff3 can also do an automatic merge when configured for it (which they are by default). And taking into account Steve's explanation, the buttons appear to be more a choice between tools than between 'auto' or 'manual'.

  5. Steve Borho

    It's even more complicated than I described. Many external tools are configured in [merge-tools] with premerge=True, which means that even if you want to launch your external diff tool it will try to use the internal merge routine first and resolve trivial merges without opening your configured merge tool.

    So the second option is: launch your selected merge tool unless a file pattern picks another tool and unless it has premerge=True in which case it may be merged automatically.

  6. Steve Borho

    resolve: improve button names (closes #81)

    Renamed 'Auto Resolve' to 'Mercurial Resolve', as suggested by Johan Renamed 'Manual Resolve' to 'Tool Resolve'. Also improved both tooltips a bit.

    I chose not to use the selected tool name in the button because it would affect the layout of the resolve tool.


  7. Chadrick Mahaffey

    We are running into a lot of issues where we are using WinMerge or KDiff and the Manual Merge tool is automatically merging the wrong line of code. Is this part of the "premerge=True" issue? How can we be certain this is off and that it pulls up our UI tool of choice everytime?

  8. Steve Borho


    You can override merge-tool configurables in your user Mercurial.ini file. Just find the line you disagree, copy/paste to to your user file then change the value.

  9. John Thoits

    Just thought I'd point out, although renaming the buttons technically "fixes" this bug report, you might want to consider whether that's actually offering the functionality that is desirable. Why would this issue have been reported if the user didn't want to see the merge result? Sure, his report shows how flexible a user he is, but he obviously was trying the button because he thought it would do what would have been helpful to him.

    I say this because I'm now running into the same issue as the author, *even with the renamed buttons! (sure, call me an idiot, and say that resolves the issue ;-)*, I didn't understand why it was behaving as it was. Usually when I use a software program, and there's a button, I use the "intuitive" approach and think, "why would this button be here," and I can't imagine why the Tool Resolve would exist if I didn't want to use my tool to control the merge. Instead, however, it uses my tool without putting any control into my hands. So, where's the button that lets me review the merge even without conflicts?

    (BTW, using three-way diff after the fact does not help me at all: there's no way to get the changes from beyond compare back into Tortoise)

  10. Mike Wilkes reporter

    john: As per Steve's comments, the problem is the choice of default options by the developers for the tools. These are stored in your thg install directory. hgrc.d\MergeTools.rc on windows.

    If you search that file, find your tool, copy the lines there to your mercurial.ini under the [merge-tools] header, and change the offending options, THG will now do what you want.

    Yes, I'm accommodating. Fortunately this is something I can control, and it's not hard, but it's far from intuitive.

    I do disagree with the default options, and think they should be changed so that tool resolve does just that. Nothing auto should be happening, and any options defined in the MergeTools.rc that allow a merge tool to do some form of auto merge should be removed.

    My 2c addition.

  11. Log in to comment