Bug 4041 - Rebase creates more more conflicts then expected
Summary: Rebase creates more more conflicts then expected
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: rebase (show other bugs)
Version: unspecified
Hardware: All All
: normal bug
Assignee: Bugzilla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-17 22:17 UTC by Steven
Modified: 2014-01-06 10:42 UTC (History)
6 users (show)

See Also:
Python Version: ---


Attachments
Sample repository with problematic tree. (3.48 KB, application/x-gzip)
2013-09-17 22:17 UTC, Steven
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Steven 2013-09-17 22:17 UTC
Created attachment 1740 [details]
Sample repository with problematic tree.

Merging during rebase does not favor base in the rebased set, causing rebase to redo previously resolved merges.

Reproduce:
See attached repository.  The tree starts like http://imgur.com/ELNVaXd

$ hg rebase -s9 -d2 --keep --tool internal:merge

merging f1.txt
warning: conflicts during merge.
merging f1.txt incomplete! (edit conflicts, then use 'hg resolve --mark')
unresolved conflicts (see hg resolve, then hg rebase --continue)

Expected Results:
HG should resolve merge between (rebased 9) and 7 automatically.

Encountered in Mercurial 2.7 (Linux).
Also reproduced on Windows and OSX, and in Mercurial 2.5.4.
Comment 1 Pierre-Yves David 2013-09-18 16:53 UTC
Able to confirm the bug with the provided test case.

The first parent is used as the rebase base instead of the second parent (that was in the rebase set)
Comment 2 HG Bot 2013-11-01 18:00 UTC
Fixed by http://selenic.com/repo/hg/rev/ad9db007656f
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
rebase: fix selection of base used when rebasing merge (issue4041)

Prior this changeset, rebasing a merge whose first parent was not in
the rebase lead to wrong and highly conflicting merge. See the in-line
comment for details.

Test have been updated with the data provided by the reported.

(please test the fix)