tests/test-mq-qpush-fail
changeset 12467 05e1171cf4ca
parent 12466 3160698100c6
child 12468 d8bf747d2e29
equal deleted inserted replaced
12466:3160698100c6 12467:05e1171cf4ca
     1 #!/bin/sh
       
     2 
       
     3 # Test that qpush cleans things up if it doesn't complete
       
     4 
       
     5 echo "[extensions]" >> $HGRCPATH
       
     6 echo "mq=" >> $HGRCPATH
       
     7 
       
     8 hg init repo
       
     9 cd repo
       
    10 
       
    11 echo foo > foo
       
    12 hg ci -Am 'add foo'
       
    13 
       
    14 touch untracked-file
       
    15 echo 'syntax: glob' > .hgignore
       
    16 echo '.hgignore' >> .hgignore
       
    17 
       
    18 hg qinit
       
    19 
       
    20 echo '% test qpush on empty series'
       
    21 hg qpush
       
    22 
       
    23 hg qnew patch1
       
    24 echo >> foo
       
    25 hg qrefresh -m 'patch 1'
       
    26 
       
    27 hg qnew patch2
       
    28 echo bar > bar
       
    29 hg add bar
       
    30 hg qrefresh -m 'patch 2'
       
    31 
       
    32 hg qnew --config 'mq.plain=true' bad-patch
       
    33 echo >> foo
       
    34 hg qrefresh
       
    35 
       
    36 hg qpop -a
       
    37 
       
    38 python -c 'print "\xe9"' > message
       
    39 cat .hg/patches/bad-patch >> message
       
    40 mv message .hg/patches/bad-patch
       
    41 
       
    42 hg qpush -a && echo 'qpush succeded?!'
       
    43 
       
    44 hg parents
       
    45 
       
    46 echo '% bar should be gone; other unknown/ignored files should still be around'
       
    47 hg status -A
       
    48 
       
    49 echo '% preparing qpush of a missing patch'
       
    50 hg qpop -a
       
    51 hg qpush
       
    52 rm .hg/patches/patch2
       
    53 echo '% now we expect the push to fail, but it should NOT complain about patch1'
       
    54 hg qpush
       
    55 
       
    56 echo '% preparing qpush of missing patch with no patch applied'
       
    57 hg qpop -a
       
    58 rm .hg/patches/patch1
       
    59 echo '% qpush should fail the same way as below'
       
    60 hg qpush
       
    61 
       
    62 true # happy ending