ediff: Merges with ancestor: Fix computation of hunks and proposed merge
Hunks were not computed correctly because the diff3 command was
invoked with arguments in an incorrect order. The correct order is
the local file first, the base (or "ancestor") second and the other
file third. This erroneous behavior had two consequences. First, the
output of diff3 would change, since it tries to merge chunks according
to maximal matches between the second and first files, and the second
and third files. Second, ediff, more precisely, `ediff-do-merge',
would consequently try to merge the reverse of the changes from the
base to the other file.
* lisp/vc/ediff-diff.el (ediff-setup-diff-regions3): In the arguments
to `ediff-exec-process', swap the other file with the ancestor (only
when merging with an ancestor).
(ediff-extract-diffs3): Match the hunk data for the ancestor and the
other file correctly. The local variable `three-way-comp' indicates
this is a merge with ancestors when it is nil.