diff options
Diffstat (limited to 'tests/test-rebase-collapse.t')
-rw-r--r-- | tests/test-rebase-collapse.t | 272 |
1 files changed, 16 insertions, 256 deletions
diff --git a/tests/test-rebase-collapse.t b/tests/test-rebase-collapse.t index a89b8fe..1266f82 100644 --- a/tests/test-rebase-collapse.t +++ b/tests/test-rebase-collapse.t @@ -2,21 +2,16 @@ > [extensions] > graphlog= > rebase= - > mq= - > - > [phases] - > publish=False > > [alias] > tglog = log -G --template "{rev}: '{desc}' {branches}\n" - > tglogp = log -G --template "{rev}:{phase} '{desc}' {branches}\n" > EOF Create repo a: $ hg init a $ cd a - $ hg unbundle "$TESTDIR/bundles/rebase.hg" + $ hg unbundle $TESTDIR/bundles/rebase.hg adding changesets adding manifests adding file changes @@ -45,31 +40,28 @@ Create repo a: $ cd .. -Rebasing B onto H and collapsing changesets with different phases: - +Rebasing B onto H: $ hg clone -q -u 3 a a1 $ cd a1 - $ hg phase --force --secret 3 - $ hg rebase --collapse --keepbranches saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob) - $ hg tglogp - @ 5:secret 'Collapsed revision + $ hg tglog + @ 5: 'Collapsed revision | * B | * C | * D' - o 4:draft 'H' + o 4: 'H' | - | o 3:draft 'G' + | o 3: 'G' |/| - o | 2:draft 'F' + o | 2: 'F' | | - | o 1:draft 'E' + | o 1: 'E' |/ - o 0:draft 'A' + o 0: 'A' $ hg manifest A @@ -82,13 +74,12 @@ Rebasing B onto H and collapsing changesets with different phases: $ cd .. -Rebasing E onto H: +Rebasing G onto H: $ hg clone -q -u . a a2 $ cd a2 - $ hg phase --force --secret 6 - $ hg rebase --source 4 --collapse + $ hg rebase --base 6 --collapse saved backup bundle to $TESTTMP/a2/.hg/strip-backup/*-backup.hg (glob) $ hg tglog @@ -124,7 +115,7 @@ Rebasing G onto H with custom message: abort: message can only be specified with collapse [255] - $ hg rebase --source 4 --collapse -m 'custom message' + $ hg rebase --base 6 --collapse -m 'custom message' saved backup bundle to $TESTTMP/a3/.hg/strip-backup/*-backup.hg (glob) $ hg tglog @@ -231,7 +222,7 @@ Rebase and collapse - more than one external (fail): Rebase and collapse - E onto H: - $ hg rebase -s 4 --collapse # root (4) is not a merge + $ hg rebase -s 4 --collapse saved backup bundle to $TESTTMP/b1/.hg/strip-backup/*-backup.hg (glob) $ hg tglog @@ -251,6 +242,7 @@ Rebase and collapse - E onto H: $ hg manifest A + B C D E @@ -260,44 +252,6 @@ Rebase and collapse - E onto H: $ cd .. - - -Test that branchheads cache is updated correctly when doing a strip in which -the parent of the ancestor node to be stripped does not become a head and -also, the parent of a node that is a child of the node stripped becomes a head -(node 3). - - $ hg clone -q -u . b b2 - $ cd b2 - - $ hg heads --template="{rev}:{node} {branch}\n" - 7:c65502d4178782309ce0574c5ae6ee9485a9bafa default - 6:c772a8b2dc17629cec88a19d09c926c4814b12c7 default - - $ cat $TESTTMP/b2/.hg/cache/branchheads - c65502d4178782309ce0574c5ae6ee9485a9bafa 7 - c772a8b2dc17629cec88a19d09c926c4814b12c7 default - c65502d4178782309ce0574c5ae6ee9485a9bafa default - - $ hg strip 4 - saved backup bundle to $TESTTMP/b2/.hg/strip-backup/8a5212ebc852-backup.hg (glob) - - $ cat $TESTTMP/b2/.hg/cache/branchheads - c65502d4178782309ce0574c5ae6ee9485a9bafa 4 - 2870ad076e541e714f3c2bc32826b5c6a6e5b040 default - c65502d4178782309ce0574c5ae6ee9485a9bafa default - - $ hg heads --template="{rev}:{node} {branch}\n" - 4:c65502d4178782309ce0574c5ae6ee9485a9bafa default - 3:2870ad076e541e714f3c2bc32826b5c6a6e5b040 default - - $ cd .. - - - - - - Create repo c: $ hg init c @@ -378,7 +332,7 @@ Rebase and collapse - E onto I: $ hg clone -q -u . c c1 $ cd c1 - $ hg rebase -s 4 --collapse # root (4) is not a merge + $ hg rebase -s 4 --collapse merging E saved backup bundle to $TESTTMP/c1/.hg/strip-backup/*-backup.hg (glob) @@ -400,6 +354,7 @@ Rebase and collapse - E onto I: $ hg manifest A + B C D E @@ -497,14 +452,12 @@ Interactions between collapse and keepbranches $ hg branch '1' marked working directory as branch 1 - (branches are permanent and global, did you want a bookmark?) $ echo 'b' > b $ hg ci -Am 'B' adding b $ hg branch '2' marked working directory as branch 2 - (branches are permanent and global, did you want a bookmark?) $ echo 'c' > c $ hg ci -Am 'C' adding c @@ -527,196 +480,3 @@ Interactions between collapse and keepbranches abort: cannot collapse multiple named branches [255] - $ repeatchange() { - > hg checkout $1 - > hg cp d z - > echo blah >> z - > hg commit -Am "$2" --user "$3" - > } - $ repeatchange 3 "E" "user1" - 0 files updated, 0 files merged, 0 files removed, 0 files unresolved - $ repeatchange 3 "E" "user2" - 0 files updated, 0 files merged, 1 files removed, 0 files unresolved - created new head - $ hg tglog - @ 5: 'E' - | - | o 4: 'E' - |/ - o 3: 'D' - | - | o 2: 'C' 2 - | | - | o 1: 'B' 1 - |/ - o 0: 'A' - - $ hg rebase -s 5 -d 4 - saved backup bundle to $TESTTMP/e/.hg/strip-backup/*-backup.hg (glob) - $ hg tglog - @ 4: 'E' - | - o 3: 'D' - | - | o 2: 'C' 2 - | | - | o 1: 'B' 1 - |/ - o 0: 'A' - - $ hg export tip - # HG changeset patch - # User user1 - # Date 0 0 - # Node ID f338eb3c2c7cc5b5915676a2376ba7ac558c5213 - # Parent 41acb9dca9eb976e84cd21fcb756b4afa5a35c09 - E - - diff -r 41acb9dca9eb -r f338eb3c2c7c z - --- /dev/null Thu Jan 01 00:00:00 1970 +0000 - +++ b/z Thu Jan 01 00:00:00 1970 +0000 - @@ -0,0 +1,2 @@ - +d - +blah - - $ cd .. - -Rebase, collapse and copies - - $ hg init copies - $ cd copies - $ hg unbundle "$TESTDIR/bundles/renames.hg" - adding changesets - adding manifests - adding file changes - added 4 changesets with 11 changes to 7 files (+1 heads) - (run 'hg heads' to see heads, 'hg merge' to merge) - $ hg up -q tip - $ hg tglog - @ 3: 'move2' - | - o 2: 'move1' - | - | o 1: 'change' - |/ - o 0: 'add' - - $ hg rebase --collapse -d 1 - merging a and d to d - merging b and e to e - merging c and f to f - merging e and g to g - merging f and c to c - saved backup bundle to $TESTTMP/copies/.hg/strip-backup/*-backup.hg (glob) - $ hg st - $ hg st --copies --change . - A d - a - A g - b - R b - $ cat c - c - c - $ cat d - a - a - $ cat g - b - b - $ hg log -r . --template "{file_copies}\n" - d (a)g (b) - -Test collapsing a middle revision in-place - - $ hg tglog - @ 2: 'Collapsed revision - | * move1 - | * move2' - o 1: 'change' - | - o 0: 'add' - - $ hg rebase --collapse -r 1 -d 0 - abort: can't remove original changesets with unrebased descendants - (use --keep to keep original changesets) - [255] - -Test collapsing in place - - $ hg rebase --collapse -b . -d 0 - saved backup bundle to $TESTTMP/copies/.hg/strip-backup/*-backup.hg (glob) - $ hg st --change . --copies - M a - M c - A d - a - A g - b - R b - $ cat a - a - a - $ cat c - c - c - $ cat d - a - a - $ cat g - b - b - $ cd .. - - -Test stripping a revision with another child - - $ hg init f - $ cd f - - $ echo A > A - $ hg ci -Am A - adding A - $ echo B > B - $ hg ci -Am B - adding B - - $ hg up -q 0 - - $ echo C > C - $ hg ci -Am C - adding C - created new head - - $ hg tglog - @ 2: 'C' - | - | o 1: 'B' - |/ - o 0: 'A' - - - - $ hg heads --template="{rev}:{node} {branch}: {desc}\n" - 2:c5cefa58fd557f84b72b87f970135984337acbc5 default: C - 1:27547f69f25460a52fff66ad004e58da7ad3fb56 default: B - - $ hg strip 2 - 0 files updated, 0 files merged, 1 files removed, 0 files unresolved - saved backup bundle to $TESTTMP/f/.hg/strip-backup/*-backup.hg (glob) - - $ hg tglog - o 1: 'B' - | - @ 0: 'A' - - - - $ hg heads --template="{rev}:{node} {branch}: {desc}\n" - 1:27547f69f25460a52fff66ad004e58da7ad3fb56 default: B - - $ cd .. - - - - |