Mercurial > hg > mercurial-source
changeset 14119:624e5ce615ec
tests: upgrade bundles/rebase.hg to support test-rebase-collapse
Add two changesets to the scenario so that the bundle can be reused
within three tests.
Before:
@ 5: 'F'
|
| o 4: 'E'
|/|
o | 3: 'D
| |
| o 2: 'C'
|/
| o 1: 'B'
|/
o 0: 'A'
After:
@ 7: 'H'
|
| o 6: 'G'
|/|
o | 5: 'F'
| |
| o 4: 'E'
|/
| o 3: 'D'
| |
| o 2: 'C'
| |
| o 1: 'B'
|/
o 0: 'A'
Revisions 0-1 keep the same number/label. Others were translated by
an offset of 2 (2.C -> 4.E)
author | Nicolas Dumazet <nicdumz.commits@gmail.com> |
---|---|
date | Sat, 30 Apr 2011 17:38:06 +0200 |
parents | 7fd8e597f99c |
children | d7f80dbbaf49 |
files | tests/bundles/rebase.hg tests/bundles/rebase.sh tests/test-rebase-collapse.t tests/test-rebase-named-branches.t tests/test-rebase-scenario-global.t |
diffstat | 5 files changed, 167 insertions(+), 134 deletions(-) [+] |
line wrap: on
line diff
index 12007c0e2e6a4429a3f527d61dca3020a99db448..69f1b6d335a54ecddb6a9f535927d7b3b8575099 GIT binary patch literal 1663 zc$@)$27viUM=>x$T4*^jL0KkKS?K@uBLDzhfB*i!-}e9ifA|0Q(cS<5?|=XQ?*IP1 z|NpE1-|znCd-u=;`*}rx8(_cyfB<L!8Z-a^(UV4uLqGrkWCn&1Xc`7U000^^00003 zLqGrk85#fvq|#4R^J<VVWj2wJ!Z8e)2dSe?GHL2JsM0+r>S?6JF&Q)rnhi2yWHK|< zgCjwsA)`Rk2*hYK$ixE(!UllUXwVY`Q%N+?00Ton&;S4f)HKixfB~QbMt}oBpa1{> z13&-+Kmnj=0RRBd05oU-0i!037>0lV0LTptAkZ`nfB*nAXaE2J28MtD05UWH2&yR& z>FS@Uq-5G?Xpd0+Aq_OsBhfQN$>dF>GHH`FGa?3=spw4ys6913O*CRXN2q#gZ6~Pp z9;VYoc~4N&Ow{t4X|ji;c|qxlX_GcoauLpMz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-g;os z0j8TCLaMM*mx!z}q{i0@xs7w9WVA)FU^OrGOR#x4n3VxGNvNP;dWkH7V=Xd^N%v8A z@i`y@?n7$V9qNt~DzqKzTMDmLNh}bQ76`VSy?q3Ljz{eo?5#BpNzIcOdU_~js3;pO z{A*IW+EPj!R>d)Nd0?{)dr7m|1dwBQSTeYs_m7kP!ZtW78ECmr;5}$FhFoZPc_6BX zX~w@zb^j18TQP{{ZPx88wLw%*$%dPv5{zKSXdynkfWm~(UiNmQOdnS|2H|`8^tUu& zkCz*{TcP6z0BzSSZ(?LCR{=EP+S%S7{r9m+Pl8c-5K((~<bjutwIssOKg)Y`W_xyE zHqG<w$YbPQ;M%1_luVjf60q;m5uRQmVsx)OHs+=(WlmihY&hXEvX}vVkQwSwn)O3x zWx>y5!kP=R{4{?@Dzv!{cxMM{&IKIdrD?cHyDbxnm<Q75xoMaA15O-c6TB{?l2;|_ zX8IQ<HL(d3r}~q)y^G9FKvJbVncVb-(x=l)oMFsJ9es~Cz~0V;hwlxzM&MXC9fEX; z@#Ba6AGYN8eirvCnc$F~3gF=WX>+6x(LKS9WfpBMIx!Nm*JK)mhuzW6BzNO4lQpX_ z<yRu;&|YU|wi#XGS=8j+e2QSAbql#2@o5|+7>|H_rty8D^6Sj*<*g~xgP8xt+>uTc JBsxF+NWdpT`pf_T
--- a/tests/bundles/rebase.sh +++ b/tests/bundles/rebase.sh @@ -2,21 +2,41 @@ hg init rebase cd rebase +# @ 7: 'H' +# | +# | o 6: 'G' +# |/| +# o | 5: 'F' +# | | +# | o 4: 'E' +# |/ +# | o 3: 'D' +# | | +# | o 2: 'C' +# | | +# | o 1: 'B' +# |/ +# o 0: 'A' + echo A > A hg ci -Am A echo B > B hg ci -Am B -hg up -q -C 0 echo C > C hg ci -Am C -hg up -q -C 0 echo D > D hg ci -Am D -hg merge -r 2 -hg ci -m E -hg up -q -C 3 +hg up -q -C 0 +echo E > E +hg ci -Am E +hg up -q -C 0 echo F > F hg ci -Am F +hg merge -r 4 +hg ci -m G +hg up -q -C 5 +echo H > H +hg ci -Am H hg bundle -a ../rebase.hg
--- a/tests/test-rebase-collapse.t +++ b/tests/test-rebase-collapse.t @@ -11,45 +11,14 @@ $ hg init a $ cd a - - $ echo A > A - $ hg ci -Am A - adding A - $ echo B > B - $ hg ci -Am B - adding B - $ echo C > C - $ hg ci -Am C - adding C - $ echo D > D - $ hg ci -Am D - adding D - - $ hg up -q -C 0 - - $ echo E > E - $ hg ci -Am E - adding E - created new head - - $ hg up -q -C 0 - - $ echo F > F - $ hg ci -Am F - adding F - created new head - - $ hg merge -r 4 - 1 files updated, 0 files merged, 0 files removed, 0 files unresolved - (branch merge, don't forget to commit) - $ hg ci -m G - - $ hg up -q -C 5 - - $ echo H > H - $ hg ci -Am H - adding H - created new head + $ hg unbundle $TESTDIR/bundles/rebase.hg + adding changesets + adding manifests + adding file changes + added 8 changesets with 7 changes to 7 files (+2 heads) + (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 $ hg tglog @ 7: 'H'
--- a/tests/test-rebase-named-branches.t +++ b/tests/test-rebase-named-branches.t @@ -13,7 +13,7 @@ adding changesets adding manifests adding file changes - added 6 changesets with 5 changes to 5 files (+2 heads) + added 8 changesets with 7 changes to 7 files (+2 heads) (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 @@ -36,34 +36,42 @@ $ hg ci -m 'extra named branch' $ hg tglog - @ 6: 'extra named branch' dev + @ 8: 'extra named branch' dev | - o 5: 'F' + o 7: 'H' | - | o 4: 'E' + | o 6: 'G' |/| - o | 3: 'D' + o | 5: 'F' + | | + | o 4: 'E' + |/ + | o 3: 'D' | | | o 2: 'C' - |/ + | | | o 1: 'B' |/ o 0: 'A' - $ hg rebase -s 6 -d 5 + $ hg rebase -s 8 -d 7 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob) $ hg tglog - @ 6: 'extra named branch' + @ 8: 'extra named branch' | - o 5: 'F' + o 7: 'H' | - | o 4: 'E' + | o 6: 'G' |/| - o | 3: 'D' + o | 5: 'F' + | | + | o 4: 'E' + |/ + | o 3: 'D' | | | o 2: 'C' - |/ + | | | o 1: 'B' |/ o 0: 'A' @@ -76,28 +84,31 @@ $ cd a2 - $ echo x > x + $ echo I > I - $ hg add x - - $ hg ci -m 'G' + $ hg ci -AmI + adding I $ hg tglog - @ 6: 'G' + @ 8: 'I' | - o 5: 'F' + o 7: 'H' | - | o 4: 'E' + | o 6: 'G' |/| - o | 3: 'D' + o | 5: 'F' + | | + | o 4: 'E' + |/ + | o 3: 'D' | | | o 2: 'C' - |/ + | | | o 1: 'B' |/ o 0: 'A' - $ hg rebase -s 6 -d 5 + $ hg rebase -s 8 -d 7 abort: source is descendant of destination [255] @@ -119,21 +130,25 @@ $ hg ci -m 'extra named branch' $ hg tglog - @ 6: 'extra named branch' dev + @ 8: 'extra named branch' dev | - o 5: 'F' + o 7: 'H' | - | o 4: 'E' + | o 6: 'G' |/| - o | 3: 'D' + o | 5: 'F' + | | + | o 4: 'E' + |/ + | o 3: 'D' | | | o 2: 'C' - |/ + | | | o 1: 'B' |/ o 0: 'A' - $ hg rebase -s 5 -d 6 + $ hg rebase -s 7 -d 8 abort: source is ancestor of destination [255]
--- a/tests/test-rebase-scenario-global.t +++ b/tests/test-rebase-scenario-global.t @@ -14,7 +14,7 @@ adding changesets adding manifests adding file changes - added 6 changesets with 5 changes to 5 files (+2 heads) + added 8 changesets with 7 changes to 7 files (+2 heads) (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 @@ -22,82 +22,99 @@ Rebasing -B onto F - simple rebase: +D onto H - simple rebase: $ hg clone -q -u . a a1 $ cd a1 $ hg tglog - @ 5: 'F' + @ 7: 'H' | + | o 6: 'G' + |/| + o | 5: 'F' + | | | o 4: 'E' - |/| - o | 3: 'D' + |/ + | o 3: 'D' | | | o 2: 'C' - |/ + | | | o 1: 'B' |/ o 0: 'A' - $ hg rebase -s 1 -d 5 + + $ hg rebase -s 3 -d 7 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob) $ hg tglog - @ 5: 'B' - | - o 4: 'F' - | - | o 3: 'E' - |/| - o | 2: 'D' + @ 7: 'D' + |\ + | o 6: 'H' | | - | o 1: 'C' + | | o 5: 'G' + | |/| + | o | 4: 'F' + | | | + | | o 3: 'E' + | |/ + o | 2: 'C' + | | + o | 1: 'B' |/ o 0: 'A' $ cd .. -B onto D - intermediate point: +D onto F - intermediate point: $ hg clone -q -u . a a2 $ cd a2 - $ hg rebase -s 1 -d 3 + $ hg rebase -s 3 -d 5 saved backup bundle to $TESTTMP/a2/.hg/strip-backup/*-backup.hg (glob) $ hg tglog - @ 5: 'B' - | - | o 4: 'F' - |/ - | o 3: 'E' - |/| - o | 2: 'D' + @ 7: 'D' + |\ + | | o 6: 'H' + | |/ + | | o 5: 'G' + | |/| + | o | 4: 'F' + | | | + | | o 3: 'E' + | |/ + o | 2: 'C' | | - | o 1: 'C' + o | 1: 'B' |/ o 0: 'A' $ cd .. -C onto F - skip of E: +E onto H - skip of G: $ hg clone -q -u . a a3 $ cd a3 - $ hg rebase -s 2 -d 5 + $ hg rebase -s 4 -d 7 saved backup bundle to $TESTTMP/a3/.hg/strip-backup/*-backup.hg (glob) $ hg tglog - @ 4: 'C' + @ 6: 'E' + | + o 5: 'H' | - o 3: 'F' + o 4: 'F' | - o 2: 'D' - | + | o 3: 'D' + | | + | o 2: 'C' + | | | o 1: 'B' |/ o 0: 'A' @@ -105,21 +122,25 @@ $ cd .. -D onto C - rebase of a branching point (skip E): +F onto E - rebase of a branching point (skip G): $ hg clone -q -u . a a4 $ cd a4 - $ hg rebase -s 3 -d 2 + $ hg rebase -s 5 -d 4 saved backup bundle to $TESTTMP/a4/.hg/strip-backup/*-backup.hg (glob) $ hg tglog - @ 4: 'F' + @ 6: 'H' + | + o 5: 'F' | - o 3: 'D' + o 4: 'E' | - o 2: 'C' - | + | o 3: 'D' + | | + | o 2: 'C' + | | | o 1: 'B' |/ o 0: 'A' @@ -127,23 +148,27 @@ $ cd .. -E onto F - merged revision having a parent in ancestors of target: +G onto H - merged revision having a parent in ancestors of target: $ hg clone -q -u . a a5 $ cd a5 - $ hg rebase -s 4 -d 5 + $ hg rebase -s 6 -d 7 saved backup bundle to $TESTTMP/a5/.hg/strip-backup/*-backup.hg (glob) $ hg tglog - @ 5: 'E' + @ 7: 'G' |\ - | o 4: 'F' + | o 6: 'H' | | + | o 5: 'F' + | | + o | 4: 'E' + |/ | o 3: 'D' | | - o | 2: 'C' - |/ + | o 2: 'C' + | | | o 1: 'B' |/ o 0: 'A' @@ -151,22 +176,26 @@ $ cd .. -D onto B - E maintains C as parent: +F onto B - G maintains E as parent: $ hg clone -q -u . a a6 $ cd a6 - $ hg rebase -s 3 -d 1 + $ hg rebase -s 5 -d 1 saved backup bundle to $TESTTMP/a6/.hg/strip-backup/*-backup.hg (glob) $ hg tglog - @ 5: 'F' + @ 7: 'H' | - | o 4: 'E' + | o 6: 'G' |/| - o | 3: 'D' + o | 5: 'F' + | | + | o 4: 'E' | | - | o 2: 'C' + | | o 3: 'D' + | | | + +---o 2: 'C' | | o | 1: 'B' |/ @@ -177,45 +206,45 @@ These will fail (using --source): -E onto D - rebase onto an ancestor: +G onto F - rebase onto an ancestor: $ hg clone -q -u . a a7 $ cd a7 - $ hg rebase -s 4 -d 3 + $ hg rebase -s 6 -d 5 abort: source is descendant of destination [255] -D onto E - rebase onto a descendant: +F onto G - rebase onto a descendant: - $ hg rebase -s 3 -d 4 + $ hg rebase -s 5 -d 6 abort: source is ancestor of destination [255] -E onto B - merge revision with both parents not in ancestors of target: +G onto B - merge revision with both parents not in ancestors of target: - $ hg rebase -s 4 -d 1 - abort: cannot use revision 4 as base, result would have 3 parents + $ hg rebase -s 6 -d 1 + abort: cannot use revision 6 as base, result would have 3 parents [255] These will abort gracefully (using --base): -E onto E - rebase onto same changeset: +G onto G - rebase onto same changeset: - $ hg rebase -b 4 -d 4 + $ hg rebase -b 6 -d 6 nothing to rebase [1] -E onto D - rebase onto an ancestor: +G onto F - rebase onto an ancestor: - $ hg rebase -b 4 -d 3 + $ hg rebase -b 6 -d 5 nothing to rebase [1] -D onto E - rebase onto a descendant: +F onto G - rebase onto a descendant: - $ hg rebase -b 3 -d 4 + $ hg rebase -b 5 -d 6 nothing to rebase [1]