2007-06-21 07:34:14 +04:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Test that qpush cleans things up if it doesn't complete
|
|
|
|
|
|
|
|
echo "[extensions]" >> $HGRCPATH
|
|
|
|
echo "mq=" >> $HGRCPATH
|
|
|
|
|
|
|
|
hg init repo
|
|
|
|
cd repo
|
|
|
|
|
|
|
|
echo foo > foo
|
2009-04-26 16:29:02 +04:00
|
|
|
hg ci -Am 'add foo'
|
2007-06-21 07:34:14 +04:00
|
|
|
|
|
|
|
touch untracked-file
|
|
|
|
echo 'syntax: glob' > .hgignore
|
|
|
|
echo '.hgignore' >> .hgignore
|
|
|
|
|
|
|
|
hg qinit
|
2009-06-08 22:02:44 +04:00
|
|
|
|
|
|
|
echo '% test qpush on empty series'
|
|
|
|
hg qpush
|
|
|
|
|
2007-06-21 07:34:14 +04:00
|
|
|
hg qnew patch1
|
|
|
|
echo >> foo
|
|
|
|
hg qrefresh -m 'patch 1'
|
|
|
|
|
|
|
|
hg qnew patch2
|
|
|
|
echo bar > bar
|
|
|
|
hg add bar
|
|
|
|
hg qrefresh -m 'patch 2'
|
|
|
|
|
|
|
|
hg qnew bad-patch
|
|
|
|
echo >> foo
|
|
|
|
hg qrefresh
|
|
|
|
|
|
|
|
hg qpop -a
|
|
|
|
|
|
|
|
python -c 'print "\xe9"' > message
|
|
|
|
cat .hg/patches/bad-patch >> message
|
|
|
|
mv message .hg/patches/bad-patch
|
|
|
|
|
|
|
|
hg qpush -a && echo 'qpush succeded?!'
|
|
|
|
|
|
|
|
hg parents
|
|
|
|
|
|
|
|
echo '% bar should be gone; other unknown/ignored files should still be around'
|
|
|
|
hg status -A
|
2009-06-21 19:34:33 +04:00
|
|
|
|
|
|
|
echo '% preparing qpush of a missing patch'
|
|
|
|
hg qpop -a
|
|
|
|
hg qpush
|
|
|
|
rm .hg/patches/patch2
|
|
|
|
echo '% now we expect the push to fail, but it should NOT complain about patch1'
|
|
|
|
hg qpush
|
|
|
|
|
|
|
|
true # happy ending
|