Mercurial > hg
comparison tests/test-rebase-transaction.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 | 35ebdbb38efb |
children | dc5e5577af39 |
comparison
equal
deleted
inserted
replaced
44346:b42ce825308e | 44347:9c9cfecd4600 |
---|---|
112 $ hg tglog | 112 $ hg tglog |
113 o 5: D | 113 o 5: D |
114 | | 114 | |
115 | @ 4: Z | 115 | @ 4: Z |
116 | | | 116 | | |
117 @ | 3: C | 117 % | 3: C |
118 | | | 118 | | |
119 | o 2: Y | 119 | o 2: Y |
120 | | | 120 | | |
121 o | 1: B | 121 o | 1: B |
122 |/ | 122 |/ |
123 o 0: A | 123 o 0: A |
124 | 124 |
125 $ hg st | 125 $ hg st |
126 M C | |
127 M conflict | 126 M conflict |
128 A B | 127 A B |
128 A C | |
129 ? conflict.orig | 129 ? conflict.orig |
130 $ echo resolved > conflict | 130 $ echo resolved > conflict |
131 $ hg resolve -m | 131 $ hg resolve -m |
132 (no more unresolved files) | 132 (no more unresolved files) |
133 continue: hg rebase --continue | 133 continue: hg rebase --continue |