sapling/tests/test-mq

202 lines
2.6 KiB
Plaintext
Raw Normal View History

2006-07-29 22:14:32 +04:00
#!/bin/sh
echo "[extensions]" >> $HGRCPATH
echo "mq=" >> $HGRCPATH
2006-07-29 22:14:32 +04:00
echo % help
hg help mq
hg init a
cd a
echo a > a
hg ci -Ama
hg clone . ../k
2006-07-29 22:14:32 +04:00
mkdir b
echo z > b/z
hg ci -Ama
echo % qinit
hg qinit
cd ..
hg init b
echo % -R qinit
hg -R b qinit
hg init c
echo % qinit -c
hg --cwd c qinit -c
hg -R c/.hg/patches st
echo % qnew implies add
hg -R c qnew test.patch
hg -R c/.hg/patches st
cd a
echo % qnew -m
hg qnew -m 'foo bar' test.patch
cat .hg/patches/test.patch
echo % qrefresh
echo a >> a
hg qrefresh
2006-08-09 23:05:40 +04:00
sed -e "s/^\(diff -r \)\([a-f0-9]* \)/\1 x/" \
2006-07-29 22:14:32 +04:00
-e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
-e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" .hg/patches/test.patch
echo % qpop
hg qpop
echo % qpush
hg qpush
cd ..
echo % pop/push outside repo
hg -R a qpop
hg -R a qpush
cd a
hg qnew test2.patch
echo % qrefresh in subdir
cd b
echo a > a
hg add a
hg qrefresh
echo % pop/push -a in subdir
hg qpop -a
hg --traceback qpush -a
echo % qseries
hg qseries
echo % qapplied
hg qapplied
echo % qtop
hg qtop
echo % qprev
hg qprev
echo % qnext
hg qnext
echo % pop, qnext, qprev, qapplied
hg qpop
hg qnext
hg qprev
hg qapplied
echo % commit should fail
hg commit
echo % push should fail
hg push ../../k
2006-07-29 22:14:32 +04:00
echo % qunapplied
hg qunapplied
2006-09-12 19:26:20 +04:00
echo % qpush/qpop with index
hg qnew test1b.patch
echo 1b > 1b
hg add 1b
hg qrefresh
hg qpush 2
hg qpop 0
hg qpush test.patch+1
hg qpush test.patch+2
hg qpop test2.patch-1
hg qpop test2.patch-2
hg qpush test1b.patch+1
echo % push should succeed
hg qpop -a
hg push ../../k
2006-07-29 22:14:32 +04:00
echo % strip
cd ../../b
echo x>x
hg ci -Ama
hg strip tip 2>&1 | sed 's/\(saving bundle to \).*/\1/'
hg unbundle .hg/strip-backup/*
2006-08-17 06:49:45 +04:00
echo '% cd b; hg qrefresh'
hg init refresh
cd refresh
echo a > a
hg ci -Ama -d'0 0'
hg qnew -mfoo foo
echo a >> a
hg qrefresh
mkdir b
cd b
echo f > f
hg add f
hg qrefresh
sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
-e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" ../.hg/patches/foo
echo % hg qrefresh .
hg qrefresh .
sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
-e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" ../.hg/patches/foo
hg status
2006-10-11 23:02:06 +04:00
echo % qpush failure
cd ..
hg qrefresh
hg qnew -mbar bar
echo foo > foo
2006-10-18 21:37:34 +04:00
echo bar > bar
hg add foo bar
2006-10-11 23:02:06 +04:00
hg qrefresh
hg qpop -a
echo bar > foo
hg qpush -a
2006-10-18 21:37:34 +04:00
hg st
2006-10-11 23:02:06 +04:00
cat >>$HGRCPATH <<EOF
2006-08-17 06:49:45 +04:00
[diff]
git = True
EOF
cd ..
hg init git
cd git
hg qinit
hg qnew -m'new file' new
echo foo > new
chmod +x new
hg add new
hg qrefresh
2006-08-17 06:50:21 +04:00
sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
-e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" .hg/patches/new
2006-08-17 06:49:45 +04:00
hg qnew -m'copy file' copy
hg cp new copy
hg qrefresh
2006-08-17 06:50:21 +04:00
sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
-e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" .hg/patches/copy
2006-08-17 06:49:45 +04:00
hg qpop
hg qpush
hg qdiff