tests/test-rebase-conflicts
branchstable
changeset 12795 3cb0559e44d0
parent 12793 469850088fc1
parent 12794 6bf8d48bec8e
child 12796 bc69ba99e34b
equal deleted inserted replaced
12793:469850088fc1 12795:3cb0559e44d0
     1 #!/bin/sh
       
     2 
       
     3 . $TESTDIR/helpers.sh
       
     4 
       
     5 echo "[extensions]" >> $HGRCPATH
       
     6 echo "graphlog=" >> $HGRCPATH
       
     7 echo "rebase=" >> $HGRCPATH
       
     8 
       
     9 hg init a
       
    10 cd a
       
    11 echo 'c1' >common
       
    12 hg add common
       
    13 hg commit -d '0 0' -m "C1"
       
    14 
       
    15 echo 'c2' >>common
       
    16 hg commit -d '1 0' -m "C2"
       
    17 
       
    18 echo 'c3' >>common
       
    19 hg commit -d '2 0' -m "C3"
       
    20 
       
    21 hg update -C 1
       
    22 echo 'l1' >>extra
       
    23 hg add extra
       
    24 hg commit -d '3 0' -m "L1"
       
    25 
       
    26 sed -e 's/c2/l2/' common > common.new
       
    27 mv common.new common
       
    28 hg commit -d '4 0' -m "L2"
       
    29 
       
    30 echo 'l3' >> extra2
       
    31 hg add extra2
       
    32 hg commit -d '5 0' -m "L3"
       
    33 
       
    34 hg glog  --template '{rev}: {desc}\n'
       
    35 
       
    36 echo
       
    37 echo '% Try to call --continue'
       
    38 hg rebase --continue
       
    39 
       
    40 echo
       
    41 echo '% Conflicting rebase'
       
    42 hg rebase -s 3 -d 2
       
    43 
       
    44 echo
       
    45 echo '% Try to continue without solving the conflict'
       
    46 hg rebase --continue 
       
    47 
       
    48 echo
       
    49 echo '% Conclude rebase'
       
    50 echo 'resolved merge' >common
       
    51 hg resolve -m common
       
    52 hg rebase --continue | cleanrebase
       
    53 
       
    54 hg glog  --template '{rev}: {desc}\n'
       
    55 
       
    56 echo
       
    57 echo '% Check correctness'
       
    58 echo '  - Rev. 0'
       
    59 hg cat -r 0 common
       
    60 
       
    61 echo '  - Rev. 1'
       
    62 hg cat -r 1 common
       
    63 
       
    64 echo '  - Rev. 2'
       
    65 hg cat -r 2 common
       
    66 
       
    67 echo '  - Rev. 3'
       
    68 hg cat -r 3 common
       
    69 
       
    70 echo '  - Rev. 4'
       
    71 hg cat -r 4 common
       
    72 
       
    73 echo '  - Rev. 5'
       
    74 hg cat -r 5 common