test-rebase-scenario-global.t
250 lines
| 3.5 KiB
| text/troff
|
Tads3Lexer
/ tests / test-rebase-scenario-global.t
|
r12608 | $ cat >> $HGRCPATH <<EOF | ||
> [extensions] | ||||
> graphlog= | ||||
> rebase= | ||||
> | ||||
> [alias] | ||||
> tglog = log -G --template "{rev}: '{desc}' {branches}\n" | ||||
> EOF | ||||
$ hg init a | ||||
$ cd a | ||||
|
r14118 | $ hg unbundle $TESTDIR/bundles/rebase.hg | ||
adding changesets | ||||
adding manifests | ||||
adding file changes | ||||
|
r14119 | added 8 changesets with 7 changes to 7 files (+2 heads) | ||
|
r14118 | (run 'hg heads' to see heads, 'hg merge' to merge) | ||
$ hg up tip | ||||
3 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
|
r12608 | $ cd .. | ||
Rebasing | ||||
|
r14119 | D onto H - simple rebase: | ||
|
r12608 | |||
$ hg clone -q -u . a a1 | ||||
$ cd a1 | ||||
$ hg tglog | ||||
|
r14119 | @ 7: 'H' | ||
|
r12608 | | | ||
|
r14119 | | o 6: 'G' | ||
|/| | ||||
o | 5: 'F' | ||||
| | | ||||
|
r12608 | | o 4: 'E' | ||
|
r14119 | |/ | ||
| o 3: 'D' | ||||
|
r12608 | | | | ||
| o 2: 'C' | ||||
|
r14119 | | | | ||
|
r12608 | | o 1: 'B' | ||
|/ | ||||
o 0: 'A' | ||||
|
r14119 | |||
$ hg rebase -s 3 -d 7 | ||||
|
r12640 | saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob) | ||
|
r12608 | |||
$ hg tglog | ||||
|
r14119 | @ 7: 'D' | ||
|\ | ||||
| o 6: 'H' | ||||
|
r12608 | | | | ||
|
r14119 | | | o 5: 'G' | ||
| |/| | ||||
| o | 4: 'F' | ||||
| | | | ||||
| | o 3: 'E' | ||||
| |/ | ||||
o | 2: 'C' | ||||
| | | ||||
o | 1: 'B' | ||||
|
r12608 | |/ | ||
o 0: 'A' | ||||
$ cd .. | ||||
|
r14119 | D onto F - intermediate point: | ||
|
r12608 | |||
$ hg clone -q -u . a a2 | ||||
$ cd a2 | ||||
|
r14119 | $ hg rebase -s 3 -d 5 | ||
|
r12640 | saved backup bundle to $TESTTMP/a2/.hg/strip-backup/*-backup.hg (glob) | ||
|
r12608 | |||
$ hg tglog | ||||
|
r14119 | @ 7: 'D' | ||
|\ | ||||
| | o 6: 'H' | ||||
| |/ | ||||
| | o 5: 'G' | ||||
| |/| | ||||
| o | 4: 'F' | ||||
| | | | ||||
| | o 3: 'E' | ||||
| |/ | ||||
o | 2: 'C' | ||||
|
r12608 | | | | ||
|
r14119 | o | 1: 'B' | ||
|
r12608 | |/ | ||
o 0: 'A' | ||||
$ cd .. | ||||
|
r14119 | E onto H - skip of G: | ||
|
r12608 | |||
$ hg clone -q -u . a a3 | ||||
$ cd a3 | ||||
|
r14119 | $ hg rebase -s 4 -d 7 | ||
|
r12640 | saved backup bundle to $TESTTMP/a3/.hg/strip-backup/*-backup.hg (glob) | ||
|
r12608 | |||
$ hg tglog | ||||
|
r14119 | @ 6: 'E' | ||
| | ||||
o 5: 'H' | ||||
|
r12608 | | | ||
|
r14119 | o 4: 'F' | ||
|
r12608 | | | ||
|
r14119 | | o 3: 'D' | ||
| | | ||||
| o 2: 'C' | ||||
| | | ||||
|
r12608 | | o 1: 'B' | ||
|/ | ||||
o 0: 'A' | ||||
$ cd .. | ||||
|
r14119 | F onto E - rebase of a branching point (skip G): | ||
|
r12608 | |||
$ hg clone -q -u . a a4 | ||||
$ cd a4 | ||||
|
r14119 | $ hg rebase -s 5 -d 4 | ||
|
r12640 | saved backup bundle to $TESTTMP/a4/.hg/strip-backup/*-backup.hg (glob) | ||
|
r12608 | |||
$ hg tglog | ||||
|
r14119 | @ 6: 'H' | ||
| | ||||
o 5: 'F' | ||||
|
r12608 | | | ||
|
r14119 | o 4: 'E' | ||
|
r12608 | | | ||
|
r14119 | | o 3: 'D' | ||
| | | ||||
| o 2: 'C' | ||||
| | | ||||
|
r12608 | | o 1: 'B' | ||
|/ | ||||
o 0: 'A' | ||||
$ cd .. | ||||
|
r14119 | G onto H - merged revision having a parent in ancestors of target: | ||
|
r12608 | |||
$ hg clone -q -u . a a5 | ||||
$ cd a5 | ||||
|
r14119 | $ hg rebase -s 6 -d 7 | ||
|
r12640 | saved backup bundle to $TESTTMP/a5/.hg/strip-backup/*-backup.hg (glob) | ||
|
r12608 | |||
$ hg tglog | ||||
|
r14119 | @ 7: 'G' | ||
|
r12608 | |\ | ||
|
r14119 | | o 6: 'H' | ||
|
r12608 | | | | ||
|
r14119 | | o 5: 'F' | ||
| | | ||||
o | 4: 'E' | ||||
|/ | ||||
|
r12608 | | o 3: 'D' | ||
| | | ||||
|
r14119 | | o 2: 'C' | ||
| | | ||||
|
r12608 | | o 1: 'B' | ||
|/ | ||||
o 0: 'A' | ||||
$ cd .. | ||||
|
r14119 | F onto B - G maintains E as parent: | ||
|
r12608 | |||
$ hg clone -q -u . a a6 | ||||
$ cd a6 | ||||
|
r14119 | $ hg rebase -s 5 -d 1 | ||
|
r12640 | saved backup bundle to $TESTTMP/a6/.hg/strip-backup/*-backup.hg (glob) | ||
|
r12608 | |||
$ hg tglog | ||||
|
r14119 | @ 7: 'H' | ||
|
r12608 | | | ||
|
r14119 | | o 6: 'G' | ||
|
r12608 | |/| | ||
|
r14119 | o | 5: 'F' | ||
| | | ||||
| o 4: 'E' | ||||
|
r12608 | | | | ||
|
r14119 | | | o 3: 'D' | ||
| | | | ||||
+---o 2: 'C' | ||||
|
r12608 | | | | ||
o | 1: 'B' | ||||
|/ | ||||
o 0: 'A' | ||||
$ cd .. | ||||
These will fail (using --source): | ||||
|
r14119 | G onto F - rebase onto an ancestor: | ||
|
r12608 | |||
$ hg clone -q -u . a a7 | ||||
$ cd a7 | ||||
|
r14119 | $ hg rebase -s 6 -d 5 | ||
|
r12608 | abort: source is descendant of destination | ||
[255] | ||||
|
r14119 | F onto G - rebase onto a descendant: | ||
|
r12608 | |||
|
r14119 | $ hg rebase -s 5 -d 6 | ||
|
r12608 | abort: source is ancestor of destination | ||
[255] | ||||
|
r14119 | G onto B - merge revision with both parents not in ancestors of target: | ||
|
r12608 | |||
|
r14119 | $ hg rebase -s 6 -d 1 | ||
abort: cannot use revision 6 as base, result would have 3 parents | ||||
|
r12608 | [255] | ||
These will abort gracefully (using --base): | ||||
|
r14119 | G onto G - rebase onto same changeset: | ||
|
r12608 | |||
|
r14119 | $ hg rebase -b 6 -d 6 | ||
|
r12608 | nothing to rebase | ||
[1] | ||||
|
r14119 | G onto F - rebase onto an ancestor: | ||
|
r12608 | |||
|
r14119 | $ hg rebase -b 6 -d 5 | ||
|
r12608 | nothing to rebase | ||
[1] | ||||
|
r14119 | F onto G - rebase onto a descendant: | ||
|
r12608 | |||
|
r14119 | $ hg rebase -b 5 -d 6 | ||
|
r12608 | nothing to rebase | ||
[1] | ||||