tests/test-rebase-conflicts
changeset 6906 808f03f61ebe
child 6910 93609576244e
equal deleted inserted replaced
6905:248e54a9456e 6906:808f03f61ebe
       
     1 #!/bin/sh
       
     2 
       
     3 echo "[extensions]" >> $HGRCPATH
       
     4 echo "graphlog=" >> $HGRCPATH
       
     5 echo "rebase=" >> $HGRCPATH
       
     6 
       
     7 function cleanoutput {
       
     8     sed -e 's/\(Rebase status stored to\).*/\1/'  \
       
     9         -e 's/\(Rebase status restored from\).*/\1/' \
       
    10         -e 's/\(saving bundle to \).*/\1/'
       
    11 }
       
    12 
       
    13 hg init a
       
    14 cd a
       
    15 echo 'c1' >common
       
    16 hg add common
       
    17 hg commit -d '0 0' -u test -m "C1"
       
    18 
       
    19 echo 'c2' >>common
       
    20 hg commit -d '1 0' -u test -m "C2"
       
    21 
       
    22 echo 'c3' >>common
       
    23 hg commit -d '2 0' -u test -m "C3"
       
    24 
       
    25 hg update -C 1
       
    26 echo 'l1' >>extra
       
    27 hg add extra
       
    28 hg commit -d '3 0' -u test -m "L1"
       
    29 
       
    30 sed -e 's/c2/l2/' common > common.new
       
    31 mv common.new common
       
    32 hg commit -d '4 0' -u test -m "L2"
       
    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 'solved merge' >common
       
    51 hg resolve -m common
       
    52 hg rebase --continue 2>&1 | cleanoutput
       
    53 
       
    54 
       
    55 hg glog  --template '{rev}: {desc}\n'