--- a/tests/test-mq Tue Feb 13 08:54:48 2007 -0500
+++ b/tests/test-mq Sat Feb 17 04:50:06 2007 -0200
@@ -169,6 +169,46 @@
hg qpop -a
hg push ../../k
+echo % qpush/qpop error codes
+errorcode()
+{
+ hg "$@" && echo " $@ succeeds" || echo " $@ fails"
+}
+
+# we want to start with some patches applied
+hg qpush -a
+echo " % pops all patches and succeeds"
+errorcode qpop -a
+echo " % does nothing and succeeds"
+errorcode qpop -a
+echo " % fails - nothing else to pop"
+errorcode qpop
+echo " % pushes a patch and succeeds"
+errorcode qpush
+echo " % pops a patch and succeeds"
+errorcode qpop
+echo " % pushes up to test1b.patch and succeeds"
+errorcode qpush test1b.patch
+echo " % does nothing and succeeds"
+errorcode qpush test1b.patch
+echo " % does nothing and succeeds"
+errorcode qpop test1b.patch
+echo " % fails - can't push to this patch"
+errorcode qpush test.patch
+echo " % fails - can't pop to this patch"
+errorcode qpop test2.patch
+echo " % pops up to test.patch and succeeds"
+errorcode qpop test.patch
+echo " % pushes all patches and succeeds"
+errorcode qpush -a
+echo " % does nothing and succeeds"
+errorcode qpush -a
+echo " % fails - nothing else to push"
+errorcode qpush
+echo " % does nothing and succeeds"
+errorcode qpush test2.patch
+
+
echo % strip
cd ../../b
echo x>x
--- a/tests/test-mq.out Tue Feb 13 08:54:48 2007 -0500
+++ b/tests/test-mq.out Sat Feb 17 04:50:06 2007 -0200
@@ -156,6 +156,61 @@
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
+% qpush/qpop error codes
+applying test.patch
+applying test1b.patch
+applying test2.patch
+Now at: test2.patch
+ % pops all patches and succeeds
+Patch queue now empty
+ qpop -a succeeds
+ % does nothing and succeeds
+no patches applied
+ qpop -a succeeds
+ % fails - nothing else to pop
+no patches applied
+ qpop fails
+ % pushes a patch and succeeds
+applying test.patch
+Now at: test.patch
+ qpush succeeds
+ % pops a patch and succeeds
+Patch queue now empty
+ qpop succeeds
+ % pushes up to test1b.patch and succeeds
+applying test.patch
+applying test1b.patch
+Now at: test1b.patch
+ qpush test1b.patch succeeds
+ % does nothing and succeeds
+qpush: test1b.patch is already at the top
+ qpush test1b.patch succeeds
+ % does nothing and succeeds
+qpop: test1b.patch is already at the top
+ qpop test1b.patch succeeds
+ % fails - can't push to this patch
+abort: cannot push to a previous patch: test.patch
+ qpush test.patch fails
+ % fails - can't pop to this patch
+abort: patch test2.patch is not applied
+ qpop test2.patch fails
+ % pops up to test.patch and succeeds
+Now at: test.patch
+ qpop test.patch succeeds
+ % pushes all patches and succeeds
+applying test1b.patch
+applying test2.patch
+Now at: test2.patch
+ qpush -a succeeds
+ % does nothing and succeeds
+all patches are currently applied
+ qpush -a succeeds
+ % fails - nothing else to push
+patch series already fully applied
+ qpush fails
+ % does nothing and succeeds
+all patches are currently applied
+ qpush test2.patch succeeds
% strip
adding x
0 files updated, 0 files merged, 1 files removed, 0 files unresolved