sapling/tests/test-amend-restack-obsolete.t
Jun Wu 164b3ff4da amend: do not rebase unrelated commits
Summary:
See the test change for what this change is about.

The new code has side effect on linearizing things for `<rebase_src>::`. This
is reflected on the second last test change. The new behavior is arguably more
desiable - The new code can fail if rebasing D onto C2 causes conflicts. If
that happens, and rebasing C+C2+D onto the new B does not cause conflicts, then
the old behavior is better. We can add fallback code to the old behavior if
there are conflicts later, by calling a plain `rebase` instead of `restack`.

Reviewed By: kulshrax

Differential Revision: D15978953

fbshipit-source-id: 20b9d62c6125ce2faf8e21bd86f6aad31ac38a0c
2019-06-26 11:24:14 -07:00

79 lines
1.5 KiB
Raku

$ . helpers-usechg.sh
$ enable amend rebase
$ setconfig rebase.experimental.inmemory=True
$ setconfig rebase.singletransaction=True
$ setconfig experimental.evolution.allowdivergence=True
$ setconfig experimental.evolution="createmarkers, allowunstable"
$ setconfig amend.autorestack=no-conflict
$ mkcommit() {
> echo "$1" > "$1"
> hg add "$1"
> hg ci -m "add $1"
> }
Test invalid value for amend.autorestack
$ newrepo
$ hg debugdrawdag<<'EOS'
> D
> |
> C C_old
> | | # amend: B_old -> B
> B B_old # amend: C_old -> C
> | /
> |/
> A
> EOS
$ hg update -qC B
$ echo "new content" > B
$ showgraph
o 5 3c36beb5705f D
|
x 4 07863d11c289 C_old
|
| o 3 26805aba1e60 C
| |
x | 2 3326d5194fc9 B_old
| |
| @ 1 112478962961 B
|/
o 0 426bada5c675 A
$ hg amend -m "B'"
restacking children automatically (unless they conflict)
rebasing 3:26805aba1e60 "C" (C)
$ showgraph
o 7 5676eb48a524 C
|
@ 6 180681c3ccd0 B'
|
| o 5 3c36beb5705f D
| |
| x 4 07863d11c289 C_old
| |
| | x 3 26805aba1e60 C
| | |
| x | 2 3326d5194fc9 B_old
|/ /
| x 1 112478962961 B
|/
o 0 426bada5c675 A
$ hg rebase --restack
rebasing 5:3c36beb5705f "D" (D)
$ showgraph
o 8 d1e904d06977 D
|
o 7 5676eb48a524 C
|
@ 6 180681c3ccd0 B'
|
| x 5 3c36beb5705f D
| |
| x 4 07863d11c289 C_old
| |
| | x 3 26805aba1e60 C
| | |
| x | 2 3326d5194fc9 B_old
|/ /
| x 1 112478962961 B
|/
o 0 426bada5c675 A