tests/test-mq-guards
changeset 2810 2e4ace008c94
child 2818 05316bb57d01
new file mode 100755
--- /dev/null
+++ b/tests/test-mq-guards
@@ -0,0 +1,62 @@
+#!/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
+hg qpush -a