[PATCH 0 of 1] rebase: fix for issue15161

Christian Boos cboos at neuf.fr
Mon Nov 9 13:22:54 CST 2009


Hello,

Here's a tentative fix for issue1561, "unnecessary merge conflicts in
rebase".

That issue draw my attention again as Matt recently closed it as being
superceded by issue1327, but wrongly so, as I found out.

Instead, the problem here was that rebase needs to "force" the
ancestor that will be used by merge.update for all rebased changesets
but the first, so that this "ancestor" is actually the parent of the
changeset being rebased.

This was done in rebasemerge, but in a somewhat fragile way, and that
"newancestor" correction was actually only performed once, while
merge.update needed that information multiple times.

I'm sure a better fix would be to pass explicitly that ancestor to
merge.update, but I don't think such a change would be appropriate in
the current time frame (and I have not looked how difficult that would
be). So for 1.4, I think it's better to keep the current
ancestor.ancestor monkey patching approach, but simply make it work.

Interestingly, the change triggers a failure in another rebase test.
Looking closer, it seems that the new output is likely the correct one
(i.e. no conflict, first rebase completes).

So what should I do here? Simply fix test-rebase-collapse.out?

..
ERROR: test-rebase-collapse output changed
--- Expected output
+++ Test output
@@ -145,17 +145,15 @@

 % Rebase and collapse - E onto I
 merging E
-warning: conflicts during merge.
-merging E failed!
-abort: fix unresolved conflicts with hg resolve then run hg rebase --continue
+saving bundle to /tmp/hgtests.xuAOBB/test-rebase-collapse/a/.hg/strip-backup/3649493a507a-temp
+adding branch
+adding changesets
+adding manifests
+adding file changes
+added 2 changesets with 3 changes to 3 files
+rebase completed
 % Fix conflict and continue
-saving bundle to
-adding branch
-adding changesets
-adding manifests
-adding file changes
-added 2 changesets with 3 changes to 3 files
-rebase completed
+abort: no rebase in progress
 @    5: Collapsed revision
 |\   * E
 | |  * F
!...........
Failed test-rebase-collapse: output changed
# Ran 14 tests, 0 skipped, 1 failed.


-- Christian


More information about the Mercurial-devel mailing list