Message7098

Author kiilerix
Recipients abuehl, benallard, mathieu.clabaut
Date 2008-09-12.19:07:07
Content
What platform are you on and which mercurial distribution do you use? And what
merge tool? What is the output of "debugconfig"?


I have tested on a reduced test case with mercurial-1.0.1-4.fc9.i386:

hg clone -r ce0d2ade64f0 ~/Download/mergetest.hg mergetest
cd mergetest

The merge can be repeated and debugged with

hg up -C 5fe2240ba89b
hg --debug -v merge -r 328376af27c1

I get a better - but more manual - merge experience with meld with

hg --config merge-tools.meld.priority=10000 --config
merge-tools.meld.premerge=False merge -r 328376af27c1

I feel lucky and get the merge you expect with kdiff3 with

hg --config merge-tools.kdiff3.priority=10000 --config
merge-tools.kdiff3.premerge=False merge -r 328376af27c1

But that is pure luck; I get a more reliable merge with

hg --debug -v --config merge-tools.kdiff3.premerge=False --config
merge-tools.kdiff3.priority=10000 --config merge-tools.kdiff3.args='$base $local
$other -o $output' merge -r 328376af27c1


My premature conclusion is:

By default mercurial merge uses "premerge"; the builtin simplemerge is tried
first, and if it is successful by its own standards then the external mergetool
isn't used. I would rather call that "try-simplemerge-only" or
"simplemerge-sufficient". I don't think having "premerge" enabled by default is
safe.

kdiff3.args in the sample mergetools.rc uses "--auto" which does the same as
"premerge". Kdiff3 do however use another merge strategy and merges the testcase
different from simplemerge. But I don't think "--auto" is a safe default.

It is good practice to always review a diff before committing. And merges should
be reviewed twice, diffed to both parents. That is even more important when the
default isn't as safe as it could be. This advice could be given in tutorial and
documentation.

You consider the result of simplemerge wrong, and thus it _is_ wrong. But in
other cases exactly the same result could have been the right one. Simplemerge
is ok, but no merge tool is perfect, and no merge tool can be trusted blindly. I
think the primary purpose of merge tools are to visualize what is going on. If
you can't see and understand how and why it has been merged then it doesn't
matter how close to perfect the merge tool is.

By the way: When merging with for example meld then I could like to use the
unperfect result of something like simplemerge (or diff3) to be used as "base";
that is what I would call "premerge".

It would be very convenient if "diff" had a "--switch-parent" option like
"export" has; that would make it easier to make a second review just before
commiting.


Best Regards
Mads
Mercurial user Evaluating SafeSign ;-)
History
Date User Action Args
2008-09-12 19:07:09kiilerixsetrecipients: + mathieu.clabaut, abuehl, benallard
2008-09-12 19:07:09kiilerixsetmessageid: <1221246429.43.0.802019888004.issue1295@selenic.com>
2008-09-12 19:07:09kiilerixlinkissue1295 messages
2008-09-12 19:07:07kiilerixcreate