Mercurial > hg
diff tests/test-rebase-parameters.t @ 44347:9c9cfecd4600
rebase: don't use rebased node as dirstate p2 (BC)
When rebasing a node, we currently use the rebased node as p2 in the
dirstate until just before we commit it (we then change to the desired
parents). This p2 is visible to the user when the rebase gets
interrupted because of merge conflicts. That can be useful to the user
as a reminder of which commit is currently being rebased, but I
believe it's incorrect for a few reasons:
* I think the dirstate parents should be the ones that will be set
when the commit is created.
* I think having two parents means that you're merging those two
commits, but when rebasing, you're generally grafting, not merging.
* When rebasing a merge commit, we should use the two desired parents
as dirstate parents (and we clearly can't have the rebased node as
a third dirstate parent).
* `hg graft` (and `hg update --merge`) sets only one parent and `hg
rebase` should be consistent with that.
I realize that this is a somewhat large user-visible change, but I
think it's worth it because it will simplify things quite a bit.
Differential Revision: https://phab.mercurial-scm.org/D7827
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Fri, 10 Jan 2020 14:22:20 -0800 |
parents | 830eae18b2f3 |
children | 05654ea5137c |
line wrap: on
line diff
--- a/tests/test-rebase-parameters.t Fri Jan 10 14:17:56 2020 -0800 +++ b/tests/test-rebase-parameters.t Fri Jan 10 14:22:20 2020 -0800 @@ -481,11 +481,9 @@ $ hg summary parent: 1:56daeba07f4b c2 - parent: 2:e4e3f3546619 tip - c2b branch: default - commit: 1 modified, 1 unresolved (merge) - update: (current) + commit: 1 unresolved (clean) + update: 1 new changesets, 2 branch heads (merge) phases: 3 draft rebase: 0 rebased, 1 remaining (rebase --continue)