##// END OF EJS Templates
phases: don't complain if cset is already public on pushkey (issue3230)
phases: don't complain if cset is already public on pushkey (issue3230)

File last commit:

r15945:cd42f77d stable
r16051:2aa5b51f 2.1 stable
Show More
test-rebase-scenario-global.t
547 lines | 8.3 KiB | text/troff | Tads3Lexer
/ tests / test-rebase-scenario-global.t
Adrian Buehlmann
tests: unify test-rebase*
r12608 $ cat >> $HGRCPATH <<EOF
> [extensions]
> graphlog=
> rebase=
>
Pierre-Yves David
phases: prevent rebase to rebase immutable changeset.
r15742 > [phases]
> publish=False
>
Adrian Buehlmann
tests: unify test-rebase*
r12608 > [alias]
> tglog = log -G --template "{rev}: '{desc}' {branches}\n"
> EOF
$ hg init a
$ cd a
Nicolas Dumazet
tests: introduce a rebase bundle to use with rebase tests...
r14118 $ hg unbundle $TESTDIR/bundles/rebase.hg
adding changesets
adding manifests
adding file changes
Nicolas Dumazet
tests: upgrade bundles/rebase.hg to support test-rebase-collapse...
r14119 added 8 changesets with 7 changes to 7 files (+2 heads)
Nicolas Dumazet
tests: introduce a rebase bundle to use with rebase tests...
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
Adrian Buehlmann
tests: unify test-rebase*
r12608 $ cd ..
Rebasing
Nicolas Dumazet
tests: upgrade bundles/rebase.hg to support test-rebase-collapse...
r14119 D onto H - simple rebase:
Adrian Buehlmann
tests: unify test-rebase*
r12608
$ hg clone -q -u . a a1
$ cd a1
$ hg tglog
Nicolas Dumazet
tests: upgrade bundles/rebase.hg to support test-rebase-collapse...
r14119 @ 7: 'H'
Adrian Buehlmann
tests: unify test-rebase*
r12608 |
Nicolas Dumazet
tests: upgrade bundles/rebase.hg to support test-rebase-collapse...
r14119 | o 6: 'G'
|/|
o | 5: 'F'
| |
Adrian Buehlmann
tests: unify test-rebase*
r12608 | o 4: 'E'
Nicolas Dumazet
tests: upgrade bundles/rebase.hg to support test-rebase-collapse...
r14119 |/
| o 3: 'D'
Adrian Buehlmann
tests: unify test-rebase*
r12608 | |
| o 2: 'C'
Nicolas Dumazet
tests: upgrade bundles/rebase.hg to support test-rebase-collapse...
r14119 | |
Adrian Buehlmann
tests: unify test-rebase*
r12608 | o 1: 'B'
|/
o 0: 'A'
Nicolas Dumazet
tests: upgrade bundles/rebase.hg to support test-rebase-collapse...
r14119
$ hg rebase -s 3 -d 7
Mads Kiilerich
tests: remove redundant globs...
r12640 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob)
Adrian Buehlmann
tests: unify test-rebase*
r12608
$ hg tglog
Nicolas Dumazet
tests: upgrade bundles/rebase.hg to support test-rebase-collapse...
r14119 @ 7: 'D'
|\
| o 6: 'H'
Adrian Buehlmann
tests: unify test-rebase*
r12608 | |
Nicolas Dumazet
tests: upgrade bundles/rebase.hg to support test-rebase-collapse...
r14119 | | o 5: 'G'
| |/|
| o | 4: 'F'
| | |
| | o 3: 'E'
| |/
o | 2: 'C'
| |
o | 1: 'B'
Adrian Buehlmann
tests: unify test-rebase*
r12608 |/
o 0: 'A'
$ cd ..
Nicolas Dumazet
tests: upgrade bundles/rebase.hg to support test-rebase-collapse...
r14119 D onto F - intermediate point:
Adrian Buehlmann
tests: unify test-rebase*
r12608
$ hg clone -q -u . a a2
$ cd a2
Nicolas Dumazet
tests: upgrade bundles/rebase.hg to support test-rebase-collapse...
r14119 $ hg rebase -s 3 -d 5
Mads Kiilerich
tests: remove redundant globs...
r12640 saved backup bundle to $TESTTMP/a2/.hg/strip-backup/*-backup.hg (glob)
Adrian Buehlmann
tests: unify test-rebase*
r12608
$ hg tglog
Nicolas Dumazet
tests: upgrade bundles/rebase.hg to support test-rebase-collapse...
r14119 @ 7: 'D'
|\
| | o 6: 'H'
| |/
| | o 5: 'G'
| |/|
| o | 4: 'F'
| | |
| | o 3: 'E'
| |/
o | 2: 'C'
Adrian Buehlmann
tests: unify test-rebase*
r12608 | |
Nicolas Dumazet
tests: upgrade bundles/rebase.hg to support test-rebase-collapse...
r14119 o | 1: 'B'
Adrian Buehlmann
tests: unify test-rebase*
r12608 |/
o 0: 'A'
$ cd ..
Nicolas Dumazet
tests: upgrade bundles/rebase.hg to support test-rebase-collapse...
r14119 E onto H - skip of G:
Adrian Buehlmann
tests: unify test-rebase*
r12608
$ hg clone -q -u . a a3
$ cd a3
Nicolas Dumazet
tests: upgrade bundles/rebase.hg to support test-rebase-collapse...
r14119 $ hg rebase -s 4 -d 7
Mads Kiilerich
tests: remove redundant globs...
r12640 saved backup bundle to $TESTTMP/a3/.hg/strip-backup/*-backup.hg (glob)
Adrian Buehlmann
tests: unify test-rebase*
r12608
$ hg tglog
Nicolas Dumazet
tests: upgrade bundles/rebase.hg to support test-rebase-collapse...
r14119 @ 6: 'E'
|
o 5: 'H'
Adrian Buehlmann
tests: unify test-rebase*
r12608 |
Nicolas Dumazet
tests: upgrade bundles/rebase.hg to support test-rebase-collapse...
r14119 o 4: 'F'
Adrian Buehlmann
tests: unify test-rebase*
r12608 |
Nicolas Dumazet
tests: upgrade bundles/rebase.hg to support test-rebase-collapse...
r14119 | o 3: 'D'
| |
| o 2: 'C'
| |
Adrian Buehlmann
tests: unify test-rebase*
r12608 | o 1: 'B'
|/
o 0: 'A'
$ cd ..
Nicolas Dumazet
tests: upgrade bundles/rebase.hg to support test-rebase-collapse...
r14119 F onto E - rebase of a branching point (skip G):
Adrian Buehlmann
tests: unify test-rebase*
r12608
$ hg clone -q -u . a a4
$ cd a4
Nicolas Dumazet
tests: upgrade bundles/rebase.hg to support test-rebase-collapse...
r14119 $ hg rebase -s 5 -d 4
Mads Kiilerich
tests: remove redundant globs...
r12640 saved backup bundle to $TESTTMP/a4/.hg/strip-backup/*-backup.hg (glob)
Adrian Buehlmann
tests: unify test-rebase*
r12608
$ hg tglog
Nicolas Dumazet
tests: upgrade bundles/rebase.hg to support test-rebase-collapse...
r14119 @ 6: 'H'
|
o 5: 'F'
Adrian Buehlmann
tests: unify test-rebase*
r12608 |
Nicolas Dumazet
tests: upgrade bundles/rebase.hg to support test-rebase-collapse...
r14119 o 4: 'E'
Adrian Buehlmann
tests: unify test-rebase*
r12608 |
Nicolas Dumazet
tests: upgrade bundles/rebase.hg to support test-rebase-collapse...
r14119 | o 3: 'D'
| |
| o 2: 'C'
| |
Adrian Buehlmann
tests: unify test-rebase*
r12608 | o 1: 'B'
|/
o 0: 'A'
$ cd ..
Nicolas Dumazet
tests: upgrade bundles/rebase.hg to support test-rebase-collapse...
r14119 G onto H - merged revision having a parent in ancestors of target:
Adrian Buehlmann
tests: unify test-rebase*
r12608
$ hg clone -q -u . a a5
$ cd a5
Nicolas Dumazet
tests: upgrade bundles/rebase.hg to support test-rebase-collapse...
r14119 $ hg rebase -s 6 -d 7
Mads Kiilerich
tests: remove redundant globs...
r12640 saved backup bundle to $TESTTMP/a5/.hg/strip-backup/*-backup.hg (glob)
Adrian Buehlmann
tests: unify test-rebase*
r12608
$ hg tglog
Nicolas Dumazet
tests: upgrade bundles/rebase.hg to support test-rebase-collapse...
r14119 @ 7: 'G'
Adrian Buehlmann
tests: unify test-rebase*
r12608 |\
Nicolas Dumazet
tests: upgrade bundles/rebase.hg to support test-rebase-collapse...
r14119 | o 6: 'H'
Adrian Buehlmann
tests: unify test-rebase*
r12608 | |
Nicolas Dumazet
tests: upgrade bundles/rebase.hg to support test-rebase-collapse...
r14119 | o 5: 'F'
| |
o | 4: 'E'
|/
Adrian Buehlmann
tests: unify test-rebase*
r12608 | o 3: 'D'
| |
Nicolas Dumazet
tests: upgrade bundles/rebase.hg to support test-rebase-collapse...
r14119 | o 2: 'C'
| |
Adrian Buehlmann
tests: unify test-rebase*
r12608 | o 1: 'B'
|/
o 0: 'A'
$ cd ..
Nicolas Dumazet
tests: upgrade bundles/rebase.hg to support test-rebase-collapse...
r14119 F onto B - G maintains E as parent:
Adrian Buehlmann
tests: unify test-rebase*
r12608
$ hg clone -q -u . a a6
$ cd a6
Nicolas Dumazet
tests: upgrade bundles/rebase.hg to support test-rebase-collapse...
r14119 $ hg rebase -s 5 -d 1
Mads Kiilerich
tests: remove redundant globs...
r12640 saved backup bundle to $TESTTMP/a6/.hg/strip-backup/*-backup.hg (glob)
Adrian Buehlmann
tests: unify test-rebase*
r12608
$ hg tglog
Nicolas Dumazet
tests: upgrade bundles/rebase.hg to support test-rebase-collapse...
r14119 @ 7: 'H'
Adrian Buehlmann
tests: unify test-rebase*
r12608 |
Nicolas Dumazet
tests: upgrade bundles/rebase.hg to support test-rebase-collapse...
r14119 | o 6: 'G'
Adrian Buehlmann
tests: unify test-rebase*
r12608 |/|
Nicolas Dumazet
tests: upgrade bundles/rebase.hg to support test-rebase-collapse...
r14119 o | 5: 'F'
| |
| o 4: 'E'
Adrian Buehlmann
tests: unify test-rebase*
r12608 | |
Nicolas Dumazet
tests: upgrade bundles/rebase.hg to support test-rebase-collapse...
r14119 | | o 3: 'D'
| | |
+---o 2: 'C'
Adrian Buehlmann
tests: unify test-rebase*
r12608 | |
o | 1: 'B'
|/
o 0: 'A'
$ cd ..
These will fail (using --source):
Nicolas Dumazet
tests: upgrade bundles/rebase.hg to support test-rebase-collapse...
r14119 G onto F - rebase onto an ancestor:
Adrian Buehlmann
tests: unify test-rebase*
r12608
$ hg clone -q -u . a a7
$ cd a7
Nicolas Dumazet
tests: upgrade bundles/rebase.hg to support test-rebase-collapse...
r14119 $ hg rebase -s 6 -d 5
Pierre-Yves David
rebase: use revset as soon as possible in internal logic...
r15267 nothing to rebase
[1]
Adrian Buehlmann
tests: unify test-rebase*
r12608
Nicolas Dumazet
tests: upgrade bundles/rebase.hg to support test-rebase-collapse...
r14119 F onto G - rebase onto a descendant:
Adrian Buehlmann
tests: unify test-rebase*
r12608
Nicolas Dumazet
tests: upgrade bundles/rebase.hg to support test-rebase-collapse...
r14119 $ hg rebase -s 5 -d 6
Adrian Buehlmann
tests: unify test-rebase*
r12608 abort: source is ancestor of destination
[255]
Nicolas Dumazet
tests: upgrade bundles/rebase.hg to support test-rebase-collapse...
r14119 G onto B - merge revision with both parents not in ancestors of target:
Adrian Buehlmann
tests: unify test-rebase*
r12608
Nicolas Dumazet
tests: upgrade bundles/rebase.hg to support test-rebase-collapse...
r14119 $ hg rebase -s 6 -d 1
abort: cannot use revision 6 as base, result would have 3 parents
Adrian Buehlmann
tests: unify test-rebase*
r12608 [255]
These will abort gracefully (using --base):
Nicolas Dumazet
tests: upgrade bundles/rebase.hg to support test-rebase-collapse...
r14119 G onto G - rebase onto same changeset:
Adrian Buehlmann
tests: unify test-rebase*
r12608
Nicolas Dumazet
tests: upgrade bundles/rebase.hg to support test-rebase-collapse...
r14119 $ hg rebase -b 6 -d 6
Adrian Buehlmann
tests: unify test-rebase*
r12608 nothing to rebase
[1]
Nicolas Dumazet
tests: upgrade bundles/rebase.hg to support test-rebase-collapse...
r14119 G onto F - rebase onto an ancestor:
Adrian Buehlmann
tests: unify test-rebase*
r12608
Nicolas Dumazet
tests: upgrade bundles/rebase.hg to support test-rebase-collapse...
r14119 $ hg rebase -b 6 -d 5
Adrian Buehlmann
tests: unify test-rebase*
r12608 nothing to rebase
[1]
Nicolas Dumazet
tests: upgrade bundles/rebase.hg to support test-rebase-collapse...
r14119 F onto G - rebase onto a descendant:
Adrian Buehlmann
tests: unify test-rebase*
r12608
Nicolas Dumazet
tests: upgrade bundles/rebase.hg to support test-rebase-collapse...
r14119 $ hg rebase -b 5 -d 6
Adrian Buehlmann
tests: unify test-rebase*
r12608 nothing to rebase
[1]
Pierre-Yves David
rebase: allow rebase to ancestor (issue3010)...
r15132 C onto A - rebase onto an ancestor:
$ hg rebase -d 0 -s 2
Mads Kiilerich
tests: make (glob) on windows accept \ instead of /...
r15447 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/5fddd98957c8-backup.hg (glob)
Pierre-Yves David
rebase: allow rebase to ancestor (issue3010)...
r15132 $ 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'
Pierre-Yves David
phases: prevent rebase to rebase immutable changeset.
r15742
Check rebasing public changeset
$ hg pull --config phases.publish=True -q -r 6 . # update phase of 6
$ hg rebase -d 5 -b 6
Wagner Bruna
rebase: drop uppercase in abort message
r15945 abort: can't rebase immutable changeset e1c4361dd923
Pierre-Yves David
phases: prevent rebase to rebase immutable changeset.
r15742 (see hg help phases for details)
[255]
$ hg rebase -d 5 -b 6 --keep
Alain Leufroy <alain.leufroyATgmailMYDOTcom>
rebase: fix phases movement...
r15917
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
$ hg log --template "{phase}\n" -r 9
draft
$ hg rebase -s9 -d1
saved backup bundle to $TESTTMP/a7/.hg/strip-backup/2cb10d0cfc6c-backup.hg
$ 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
$ hg log --template "{phase}\n" -r 9
secret
$ hg rebase -s9 -d1
saved backup bundle to $TESTTMP/a7/.hg/strip-backup/2a0524f868ac-backup.hg
$ hg log --template "{phase}\n" -r 9
secret
Source phase lower than destination phase: new changeset get the phase of destination:
$ hg rebase -s7 -d9
saved backup bundle to $TESTTMP/a7/.hg/strip-backup/c9659aac0000-backup.hg
$ hg log --template "{phase}\n" -r 9
secret
Pierre-Yves David
rebase: add --rev option to rebase...
r15270 $ cd ..
Pierre-Yves David
rebase: allow rebase to ancestor (issue3010)...
r15132
Pierre-Yves David
rebase: add --rev option to rebase...
r15270 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
Mads Kiilerich
tests: make (glob) on windows accept \ instead of /...
r15447 saved backup bundle to $TESTTMP/ah5/.hg/strip-backup/3d8a618087a7-backup.hg (glob)
Pierre-Yves David
rebase: add --rev option to rebase...
r15270 $ 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 ..