The biggest change I made was to break up the merge into two stages.
The merge command is run with ui.merge=internal:fail. This tells
Mercurial that if there are any files modified on both branches, they
should be marked unresolved instead of trying to run a merge tool
immediately. At the end of the merge, if there are any unresolved
files the wizard switches to a "Resolve" page where the user can
resolve conflicts at their leisure. If there were no conflicts, the
wizard jumps directly to the commit page.
This is similar to the workflow of merges with perforce, and I think
it's one of the few parts of their user interface we should mimic.
Merge tools are only opened at the direct request of the user, and
they have complete control over the resolve process. This interface
exposes the power of the resolve command, in that they can restart the
merge of any file they wish until they get all the files just as they
want them.
The resolve page is designed such that the user can press the 'auto'
button right away to make Mercurial try to do a "simplemerge" of all
unresolved files at once. This will resolve most files, unless there
is a real conflict on one or more lines.
Three known issues:
1 - there's a reference counting issue somewhere in the tool, it can
cause crashes
2 - launching commit from merge, when merge is launched from workbench
causes bad behavior
3 - the cmdui.Widget console will not grow in size in the resolve
page, no idea why
Let me know if you run into any surprising behavior.
--
Steve Borho
I'll allow that long-time Mercurial users may find this limiting, so
I've assumed that we'll eventually add a back door to revert to
default Mercurial behavior. But I have heard from many new users over
the years that this is the one part of the Mercurial interface that is
unsettling, having kdiff3 thrown at them at seemingly random
occasions, so I want the internal:fail approach to be the initial
default.
How about a new boolean setting: tortoisehg.autoresolve - set to True
to get Mercurial's default behavior. Rather than toggling between
internal:fail and internal:merge, this switch should remove the --tool
argument entirely, allowing Mercurial to use ui.merge and all the rest
of its tool selection machinery.
There are more dialogs that would need to be aware of this switch
(rebase, sync, update, backout).
--
Steve Borho
I agree with you. Most of the new users I know are somehow disturbed
by the "old" merge behaviour.
When I show them the "new" behaviour, they are enthusiast.
> How about a new boolean setting: tortoisehg.autoresolve - set to True
> to get Mercurial's default behavior. Rather than toggling between
> internal:fail and internal:merge, this switch should remove the --tool
> argument entirely, allowing Mercurial to use ui.merge and all the rest
> of its tool selection machinery.
Good idea.
> There are more dialogs that would need to be aware of this switch
> (rebase, sync, update, backout).
André
I'm fine with a checkbox or radio on the merge page so long as it
reads the default value from the configuration setting - and we use
the configuration setting in the other dialogs that need it.
> I've also encountered a few bugs in the merge and file resolution
> dialogs -- I'll send some patches for these separately over the next
> few days as and when I get the time to look at them.
Great, thanks.
--
Steve Borho