| 1 |
$ cat << EOF >> $HGRCPATH |
| 2 |
> [extensions] |
| 3 |
> rebase= |
| 4 |
> [alias] |
| 5 |
> tglog = log -G -T "{rev} '{desc}'\n" |
| 6 |
> EOF |
| 7 |
|
| 8 |
$ hg init |
| 9 |
|
| 10 |
$ echo a > a; hg add a; hg ci -m a |
| 11 |
$ echo b > b; hg add b; hg ci -m b1 |
| 12 |
$ hg up 0 -q |
| 13 |
$ echo b > b; hg add b; hg ci -m b2 -q |
| 14 |
|
| 15 |
$ hg tglog |
| 16 |
@ 2 'b2' |
| 17 |
| |
| 18 |
| o 1 'b1' |
| 19 |
|/ |
| 20 |
o 0 'a' |
| 21 |
|
| 22 |
|
| 23 |
With rewrite.empty-successor=skip, b2 is skipped because it would become empty. |
| 24 |
|
| 25 |
$ hg rebase -s 2 -d 1 --config rewrite.empty-successor=skip --dry-run |
| 26 |
starting dry-run rebase; repository will not be changed |
| 27 |
rebasing 2:6e2aad5e0f3c tip "b2" |
| 28 |
note: not rebasing 2:6e2aad5e0f3c tip "b2", its destination already has all its changes |
| 29 |
dry-run rebase completed successfully; run without -n/--dry-run to perform this rebase |
| 30 |
|
| 31 |
With rewrite.empty-successor=keep, b2 will be recreated although it became empty. |
| 32 |
|
| 33 |
$ hg rebase -s 2 -d 1 --config rewrite.empty-successor=keep |
| 34 |
rebasing 2:6e2aad5e0f3c tip "b2" |
| 35 |
note: created empty successor for 2:6e2aad5e0f3c tip "b2", its destination already has all its changes |
| 36 |
saved backup bundle to $TESTTMP/.hg/strip-backup/6e2aad5e0f3c-7d7c8801-rebase.hg |
| 37 |
|
| 38 |
$ hg tglog |
| 39 |
@ 2 'b2' |
| 40 |
| |
| 41 |
o 1 'b1' |
| 42 |
| |
| 43 |
o 0 'a' |
| 44 |
|