mirror of
https://github.com/facebook/sapling.git
synced 2024-10-12 01:39:21 +03:00
6317ba0ca2
Summary: The functionality we care about is provided by the `fbamend` extension. Therefore, lets replace the `amend` extension with the `fbamend` extension. Reviewed By: farnz Differential Revision: D10320739 fbshipit-source-id: 5700d39f488777fcc4033f60ce0a51cda15ef2ad
103 lines
2.9 KiB
Perl
103 lines
2.9 KiB
Perl
$ . helpers-usechg.sh
|
|
|
|
$ enable amend rebase
|
|
$ setconfig experimental.evolution.allowdivergence=True
|
|
$ setconfig experimental.evolution="createmarkers, allowunstable"
|
|
$ mkcommit() {
|
|
> echo "$1" > "$1"
|
|
> hg add "$1"
|
|
> hg ci -m "add $1"
|
|
> }
|
|
|
|
Test situation with divergence. Restack should rebase unstable children
|
|
onto the newest successor of their parent.
|
|
$ newrepo
|
|
$ mkcommit a
|
|
$ mkcommit b
|
|
$ mkcommit c
|
|
$ hg prev
|
|
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
|
[*] add b (glob)
|
|
$ hg amend -m "successor 1" --no-rebase
|
|
hint[amend-restack]: descendants of 7c3bad9141dc are left behind - use 'hg restack' to rebase them
|
|
hint[hint-ack]: use 'hg hint --ack amend-restack' to silence these hints
|
|
$ hg up 1
|
|
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
$ hg amend -m "successor 2" --no-rebase
|
|
hint[amend-restack]: descendants of 7c3bad9141dc are left behind - use 'hg restack' to rebase them
|
|
hint[hint-ack]: use 'hg hint --ack amend-restack' to silence these hints
|
|
$ hg up 1
|
|
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
$ showgraph
|
|
o 4 cef323f40828 successor 2
|
|
|
|
|
| o 3 f60c1f15a70e successor 1
|
|
|/
|
|
| o 2 4538525df7e2 add c
|
|
| |
|
|
| @ 1 7c3bad9141dc add b
|
|
|/
|
|
o 0 1f0dee641bb7 add a
|
|
$ hg rebase --restack
|
|
rebasing 2:4538525df7e2 "add c"
|
|
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
$ showgraph
|
|
o 5 b0a0bc953ac3 add c
|
|
|
|
|
@ 4 cef323f40828 successor 2
|
|
|
|
|
| o 3 f60c1f15a70e successor 1
|
|
|/
|
|
| x 1 7c3bad9141dc add b
|
|
|/
|
|
o 0 1f0dee641bb7 add a
|
|
|
|
Test situation with divergence due to an unamend. This should actually succeed
|
|
since the successor is obsolete.
|
|
$ newrepo
|
|
$ mkcommit a
|
|
$ mkcommit b
|
|
$ mkcommit c
|
|
$ hg prev
|
|
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
|
[*] add b (glob)
|
|
$ echo b >> b
|
|
$ hg amend
|
|
hint[amend-restack]: descendants of 7c3bad9141dc are left behind - use 'hg restack' to rebase them
|
|
hint[hint-ack]: use 'hg hint --ack amend-restack' to silence these hints
|
|
$ showgraph
|
|
@ 3 c54ee8acf83d add b
|
|
|
|
|
| o 2 4538525df7e2 add c
|
|
| |
|
|
| x 1 7c3bad9141dc add b
|
|
|/
|
|
o 0 1f0dee641bb7 add a
|
|
$ hg up 1
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
$ echo c >> b
|
|
$ hg amend
|
|
hint[amend-restack]: descendants of 7c3bad9141dc are left behind - use 'hg restack' to rebase them
|
|
hint[hint-ack]: use 'hg hint --ack amend-restack' to silence these hints
|
|
$ showgraph
|
|
@ 4 2c965323ca2a add b
|
|
|
|
|
| o 3 c54ee8acf83d add b
|
|
|/
|
|
| o 2 4538525df7e2 add c
|
|
| |
|
|
| x 1 7c3bad9141dc add b
|
|
|/
|
|
o 0 1f0dee641bb7 add a
|
|
$ hg unamend
|
|
$ hg up -C 3
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
$ showgraph
|
|
@ 3 c54ee8acf83d add b
|
|
|
|
|
| o 2 4538525df7e2 add c
|
|
| |
|
|
| o 1 7c3bad9141dc add b
|
|
|/
|
|
o 0 1f0dee641bb7 add a
|