HomePhabricator

rebase: always be graft-like, not merge-like, also for merges

Authored by martinvonz.

Description

rebase: always be graft-like, not merge-like, also for merges

Rebase works by updating to a commit and then grafting changes on
top. However, before this patch, it would actually merge in changes
instead of grafting them in in some cases. That is, it would use the
common ancestor as base instead of using one of the parents. That
seems wrong to me, so I'm changing it so defineparents() always
returns a value for base.

This fixes the bad behavior in test-rebase-newancestor.t, which was
introduced in 65f215ea3e8e (tests: add test for rebasing merges with
ancestors of the rebase destination, 2014-11-30).

The difference in test-rebase-dest.t is because the files in the tip
revision were A, D, E, F before this patch and A, D, F, G after it. I
think both files should ideally be there.

Differential Revision: https://phab.mercurial-scm.org/D7907