test-mq-guards
101 lines
| 1.3 KiB
| text/plain
|
TextLexer
/ tests / test-mq-guards
Vadim Gelfer
|
r2821 | #!/bin/sh | ||
HGRCPATH=$HGTMP/.hgrc; export HGRCPATH | ||||
echo "[extensions]" >> $HGTMP/.hgrc | ||||
echo "mq=" >> $HGTMP/.hgrc | ||||
hg init | ||||
hg qinit | ||||
echo x > x | ||||
hg ci -Ama | ||||
hg qnew a.patch | ||||
echo a > a | ||||
hg add a | ||||
hg qrefresh | ||||
hg qnew b.patch | ||||
echo b > b | ||||
hg add b | ||||
hg qrefresh | ||||
hg qnew c.patch | ||||
echo c > c | ||||
hg add c | ||||
hg qrefresh | ||||
hg qpop -a | ||||
echo % should fail | ||||
hg qguard +fail | ||||
hg qpush | ||||
echo % should guard a.patch | ||||
hg qguard +a | ||||
echo % should print +a | ||||
hg qguard | ||||
hg qpop | ||||
hg qguard a.patch | ||||
echo % should push b.patch | ||||
hg qpush | ||||
hg qpop | ||||
hg qselect a | ||||
echo % should push a.patch | ||||
hg qpush | ||||
hg qguard c.patch -a | ||||
echo % should print -a | ||||
hg qguard c.patch | ||||
echo % should skip c.patch | ||||
hg qpush -a | ||||
hg qguard -n c.patch | ||||
echo % should push c.patch | ||||
hg qpush -a | ||||
hg qpop -a | ||||
hg qselect -n | ||||
Vadim Gelfer
|
r2829 | echo % should push all | ||
Vadim Gelfer
|
r2821 | hg qpush -a | ||
Vadim Gelfer
|
r2829 | |||
hg qpop -a | ||||
Vadim Gelfer
|
r2850 | hg qguard a.patch +1 | ||
hg qguard b.patch +2 | ||||
Vadim Gelfer
|
r2829 | hg qselect 1 | ||
Vadim Gelfer
|
r2850 | echo % should push a.patch, not b.patch | ||
hg qpush | ||||
hg qpush | ||||
hg qpop -a | ||||
hg qselect 2 | ||||
Vadim Gelfer
|
r2829 | echo % should push b.patch | ||
hg qpush | ||||
hg qpop -a | ||||
Vadim Gelfer
|
r2850 | hg qselect 1 2 | ||
echo % should push a.patch, b.patch | ||||
Vadim Gelfer
|
r2829 | hg qpush | ||
hg qpush | ||||
hg qpop -a | ||||
hg qguard a.patch +1 +2 -3 | ||||
hg qselect 1 2 3 | ||||
Vadim Gelfer
|
r2850 | echo % list patches and guards | ||
hg qguard -l | ||||
echo % list series | ||||
hg qseries -v | ||||
echo % list guards | ||||
hg qselect | ||||
Vadim Gelfer
|
r2829 | echo % should push b.patch | ||
hg qpush | ||||
Vadim Gelfer
|
r2844 | |||
hg qpush -a | ||||
hg qselect -n --reapply | ||||
Vadim Gelfer
|
r2850 | echo % guards in series file: +1 +2 -3 | ||
hg qselect -s | ||||
echo % should show c.patch | ||||
hg qapplied | ||||