summaryrefslogtreecommitdiff
path: root/tests/test-rebase-scenario-global.t
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test-rebase-scenario-global.t')
-rw-r--r--tests/test-rebase-scenario-global.t349
1 files changed, 26 insertions, 323 deletions
diff --git a/tests/test-rebase-scenario-global.t b/tests/test-rebase-scenario-global.t
index 7cb6e8d..3a89d2e 100644
--- a/tests/test-rebase-scenario-global.t
+++ b/tests/test-rebase-scenario-global.t
@@ -3,9 +3,6 @@
> graphlog=
> rebase=
>
- > [phases]
- > publish=False
- >
> [alias]
> tglog = log -G --template "{rev}: '{desc}' {branches}\n"
> EOF
@@ -13,7 +10,7 @@
$ hg init a
$ cd a
- $ hg unbundle "$TESTDIR/bundles/rebase.hg"
+ $ hg unbundle $TESTDIR/bundles/rebase.hg
adding changesets
adding manifests
adding file changes
@@ -52,19 +49,19 @@ D onto H - simple rebase:
saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob)
$ hg tglog
- @ 7: 'D'
- |
- o 6: 'H'
- |
- | o 5: 'G'
- |/|
- o | 4: 'F'
+ @ 7: 'D'
+ |\
+ | o 6: 'H'
| |
- | o 3: 'E'
- |/
- | o 2: 'C'
+ | | o 5: 'G'
+ | |/|
+ | o | 4: 'F'
+ | | |
+ | | o 3: 'E'
+ | |/
+ o | 2: 'C'
| |
- | o 1: 'B'
+ o | 1: 'B'
|/
o 0: 'A'
@@ -80,19 +77,19 @@ D onto F - intermediate point:
saved backup bundle to $TESTTMP/a2/.hg/strip-backup/*-backup.hg (glob)
$ hg tglog
- @ 7: 'D'
- |
- | o 6: 'H'
- |/
- | o 5: 'G'
- |/|
- o | 4: 'F'
- | |
- | o 3: 'E'
- |/
- | o 2: 'C'
+ @ 7: 'D'
+ |\
+ | | o 6: 'H'
+ | |/
+ | | o 5: 'G'
+ | |/|
+ | o | 4: 'F'
+ | | |
+ | | o 3: 'E'
+ | |/
+ o | 2: 'C'
| |
- | o 1: 'B'
+ o | 1: 'B'
|/
o 0: 'A'
@@ -215,8 +212,8 @@ G onto F - rebase onto an ancestor:
$ cd a7
$ hg rebase -s 6 -d 5
- nothing to rebase
- [1]
+ abort: source is descendant of destination
+ [255]
F onto G - rebase onto a descendant:
@@ -251,297 +248,3 @@ F onto G - rebase onto a descendant:
nothing to rebase
[1]
-C onto A - rebase onto an ancestor:
-
- $ hg rebase -d 0 -s 2
- saved backup bundle to $TESTTMP/a7/.hg/strip-backup/5fddd98957c8-backup.hg (glob)
- $ hg tglog
- @ 7: 'D'
- |
- o 6: 'C'
- |
- | o 5: 'H'
- | |
- | | o 4: 'G'
- | |/|
- | o | 3: 'F'
- |/ /
- | o 2: 'E'
- |/
- | o 1: 'B'
- |/
- o 0: 'A'
-
-
-Check rebasing public changeset
-
- $ hg pull --config phases.publish=True -q -r 6 . # update phase of 6
- $ hg rebase -d 5 -b 6
- abort: can't rebase immutable changeset e1c4361dd923
- (see hg help phases for details)
- [255]
-
- $ hg rebase -d 5 -b 6 --keep
-
-Check rebasing mutable changeset
-Source phase greater or equal to destination phase: new changeset get the phase of source:
- $ hg rebase -s9 -d0
- saved backup bundle to $TESTTMP/a7/.hg/strip-backup/2b23e52411f4-backup.hg (glob)
- $ hg log --template "{phase}\n" -r 9
- draft
- $ hg rebase -s9 -d1
- saved backup bundle to $TESTTMP/a7/.hg/strip-backup/2cb10d0cfc6c-backup.hg (glob)
- $ hg log --template "{phase}\n" -r 9
- draft
- $ hg phase --force --secret 9
- $ hg rebase -s9 -d0
- saved backup bundle to $TESTTMP/a7/.hg/strip-backup/c5b12b67163a-backup.hg (glob)
- $ hg log --template "{phase}\n" -r 9
- secret
- $ hg rebase -s9 -d1
- saved backup bundle to $TESTTMP/a7/.hg/strip-backup/2a0524f868ac-backup.hg (glob)
- $ hg log --template "{phase}\n" -r 9
- secret
-Source phase lower than destination phase: new changeset get the phase of destination:
- $ hg rebase -s8 -d9
- saved backup bundle to $TESTTMP/a7/.hg/strip-backup/6d4f22462821-backup.hg (glob)
- $ hg log --template "{phase}\n" -r 'rev(9)'
- secret
-
- $ cd ..
-
-Test for revset
-
-We need a bit different graph
-All destination are B
-
- $ hg init ah
- $ cd ah
- $ hg unbundle "$TESTDIR/bundles/rebase-revset.hg"
- adding changesets
- adding manifests
- adding file changes
- added 9 changesets with 9 changes to 9 files (+2 heads)
- (run 'hg heads' to see heads, 'hg merge' to merge)
- $ hg tglog
- o 8: 'I'
- |
- o 7: 'H'
- |
- o 6: 'G'
- |
- | o 5: 'F'
- | |
- | o 4: 'E'
- |/
- o 3: 'D'
- |
- o 2: 'C'
- |
- | o 1: 'B'
- |/
- o 0: 'A'
-
- $ cd ..
-
-
-Simple case with keep:
-
-Source on have two descendant heads but ask for one
-
- $ hg clone -q -u . ah ah1
- $ cd ah1
- $ hg rebase -r '2::8' -d 1
- abort: can't remove original changesets with unrebased descendants
- (use --keep to keep original changesets)
- [255]
- $ hg rebase -r '2::8' -d 1 --keep
- $ hg tglog
- @ 13: 'I'
- |
- o 12: 'H'
- |
- o 11: 'G'
- |
- o 10: 'D'
- |
- o 9: 'C'
- |
- | o 8: 'I'
- | |
- | o 7: 'H'
- | |
- | o 6: 'G'
- | |
- | | o 5: 'F'
- | | |
- | | o 4: 'E'
- | |/
- | o 3: 'D'
- | |
- | o 2: 'C'
- | |
- o | 1: 'B'
- |/
- o 0: 'A'
-
-
- $ cd ..
-
-Base on have one descendant heads we ask for but common ancestor have two
-
- $ hg clone -q -u . ah ah2
- $ cd ah2
- $ hg rebase -r '3::8' -d 1
- abort: can't remove original changesets with unrebased descendants
- (use --keep to keep original changesets)
- [255]
- $ hg rebase -r '3::8' -d 1 --keep
- $ hg tglog
- @ 12: 'I'
- |
- o 11: 'H'
- |
- o 10: 'G'
- |
- o 9: 'D'
- |
- | o 8: 'I'
- | |
- | o 7: 'H'
- | |
- | o 6: 'G'
- | |
- | | o 5: 'F'
- | | |
- | | o 4: 'E'
- | |/
- | o 3: 'D'
- | |
- | o 2: 'C'
- | |
- o | 1: 'B'
- |/
- o 0: 'A'
-
-
- $ cd ..
-
-rebase subset
-
- $ hg clone -q -u . ah ah3
- $ cd ah3
- $ hg rebase -r '3::7' -d 1
- abort: can't remove original changesets with unrebased descendants
- (use --keep to keep original changesets)
- [255]
- $ hg rebase -r '3::7' -d 1 --keep
- $ hg tglog
- @ 11: 'H'
- |
- o 10: 'G'
- |
- o 9: 'D'
- |
- | o 8: 'I'
- | |
- | o 7: 'H'
- | |
- | o 6: 'G'
- | |
- | | o 5: 'F'
- | | |
- | | o 4: 'E'
- | |/
- | o 3: 'D'
- | |
- | o 2: 'C'
- | |
- o | 1: 'B'
- |/
- o 0: 'A'
-
-
- $ cd ..
-
-rebase subset with multiple head
-
- $ hg clone -q -u . ah ah4
- $ cd ah4
- $ hg rebase -r '3::(7+5)' -d 1
- abort: can't remove original changesets with unrebased descendants
- (use --keep to keep original changesets)
- [255]
- $ hg rebase -r '3::(7+5)' -d 1 --keep
- $ hg tglog
- @ 13: 'H'
- |
- o 12: 'G'
- |
- | o 11: 'F'
- | |
- | o 10: 'E'
- |/
- o 9: 'D'
- |
- | o 8: 'I'
- | |
- | o 7: 'H'
- | |
- | o 6: 'G'
- | |
- | | o 5: 'F'
- | | |
- | | o 4: 'E'
- | |/
- | o 3: 'D'
- | |
- | o 2: 'C'
- | |
- o | 1: 'B'
- |/
- o 0: 'A'
-
-
- $ cd ..
-
-More advanced tests
-
-rebase on ancestor with revset
-
- $ hg clone -q -u . ah ah5
- $ cd ah5
- $ hg rebase -r '6::' -d 2
- saved backup bundle to $TESTTMP/ah5/.hg/strip-backup/3d8a618087a7-backup.hg (glob)
- $ hg tglog
- @ 8: 'I'
- |
- o 7: 'H'
- |
- o 6: 'G'
- |
- | o 5: 'F'
- | |
- | o 4: 'E'
- | |
- | o 3: 'D'
- |/
- o 2: 'C'
- |
- | o 1: 'B'
- |/
- o 0: 'A'
-
- $ cd ..
-
-
-rebase with multiple root.
-We rebase E and G on B
-We would expect heads are I, F if it was supported
-
- $ hg clone -q -u . ah ah6
- $ cd ah6
- $ hg rebase -r '(4+6)::' -d 1
- abort: can't rebase multiple roots
- [255]
- $ cd ..