Mercurial > hg > mercurial-crew
diff tests/test-rebase-conflicts.t @ 12605:16b854cb80f1
tests: unify test-rebase*
author | Adrian Buehlmann <adrian@cadifra.com> |
---|---|
date | Fri, 01 Oct 2010 16:10:06 +0200 (2010-10-01) |
parents | tests/test-rebase-conflicts@2313dc4d9817 |
children | 6cc4b14fb76b |
line wrap: on
line diff
old mode 100755 new mode 100644 copy from tests/test-rebase-conflicts copy to tests/test-rebase-conflicts.t --- a/tests/test-rebase-conflicts +++ b/tests/test-rebase-conflicts.t @@ -1,74 +1,115 @@ -#!/bin/sh - -. $TESTDIR/helpers.sh - -echo "[extensions]" >> $HGRCPATH -echo "graphlog=" >> $HGRCPATH -echo "rebase=" >> $HGRCPATH + $ cat >> $HGRCPATH <<EOF + > [extensions] + > graphlog= + > rebase= + > + > [alias] + > tglog = log -G --template "{rev}: '{desc}' {branches}\n" + > EOF -hg init a -cd a -echo 'c1' >common -hg add common -hg commit -d '0 0' -m "C1" + $ hg init a + $ cd a + $ echo c1 >common + $ hg add common + $ hg ci -m C1 + + $ echo c2 >>common + $ hg ci -m C2 -echo 'c2' >>common -hg commit -d '1 0' -m "C2" + $ echo c3 >>common + $ hg ci -m C3 + + $ hg up -q -C 1 + + $ echo l1 >>extra + $ hg add extra + $ hg ci -m L1 + created new head -echo 'c3' >>common -hg commit -d '2 0' -m "C3" + $ sed -e 's/c2/l2/' common > common.new + $ mv common.new common + $ hg ci -m L2 -hg update -C 1 -echo 'l1' >>extra -hg add extra -hg commit -d '3 0' -m "L1" + $ echo l3 >> extra2 + $ hg add extra2 + $ hg ci -m L3 -sed -e 's/c2/l2/' common > common.new -mv common.new common -hg commit -d '4 0' -m "L2" + $ hg tglog + @ 5: 'L3' + | + o 4: 'L2' + | + o 3: 'L1' + | + | o 2: 'C3' + |/ + o 1: 'C2' + | + o 0: 'C1' + +Try to call --continue: -echo 'l3' >> extra2 -hg add extra2 -hg commit -d '5 0' -m "L3" + $ hg rebase --continue + abort: no rebase in progress + [255] -hg glog --template '{rev}: {desc}\n' +Conflicting rebase: -echo -echo '% Try to call --continue' -hg rebase --continue + $ hg rebase -s 3 -d 2 + merging common + warning: conflicts during merge. + merging common failed! + abort: fix unresolved conflicts with hg resolve then run hg rebase --continue + [255] -echo -echo '% Conflicting rebase' -hg rebase -s 3 -d 2 +Try to continue without solving the conflict: -echo -echo '% Try to continue without solving the conflict' -hg rebase --continue + $ hg rebase --continue + abort: unresolved merge conflicts (see hg resolve) + [255] -echo -echo '% Conclude rebase' -echo 'resolved merge' >common -hg resolve -m common -hg rebase --continue | cleanrebase +Conclude rebase: -hg glog --template '{rev}: {desc}\n' + $ echo 'resolved merge' >common + $ hg resolve -m common + $ hg rebase --continue + saved backup bundle to */.hg/strip-backup/*-backup.hg (glob) -echo -echo '% Check correctness' -echo ' - Rev. 0' -hg cat -r 0 common + $ hg tglog + @ 5: 'L3' + | + o 4: 'L2' + | + o 3: 'L1' + | + o 2: 'C3' + | + o 1: 'C2' + | + o 0: 'C1' + +Check correctness: -echo ' - Rev. 1' -hg cat -r 1 common + $ hg cat -r 0 common + c1 -echo ' - Rev. 2' -hg cat -r 2 common + $ hg cat -r 1 common + c1 + c2 -echo ' - Rev. 3' -hg cat -r 3 common + $ hg cat -r 2 common + c1 + c2 + c3 -echo ' - Rev. 4' -hg cat -r 4 common + $ hg cat -r 3 common + c1 + c2 + c3 -echo ' - Rev. 5' -hg cat -r 5 common + $ hg cat -r 4 common + resolved merge + + $ hg cat -r 5 common + resolved merge +