tests/test-mq-qqueue
author Nicolas Dumazet <nicdumz.commits@gmail.com>
Wed, 21 Jul 2010 11:53:09 +0900
changeset 11699 da0b9109186d
parent 11272 e8a66a40474d
child 11767 9b771b4ce2f3
permissions -rwxr-xr-x
mq: support "qimport --existing --name renametothis thatexistingpatch" Before this change, the command would abort with a not too clear "patch renametothis does not exist" error. This change makes: qimport --existing --name renametothis thatexistingpatch equivalent to: qimport --existing thatexistingpatch; qrename thatexistingpatch renametothis

#!/bin/sh

echo "[extensions]" >> $HGRCPATH
echo "mq=" >> $HGRCPATH

hg init foo
cd foo
echo a > a
hg ci -qAm a

echo %% default queue
hg qqueue

echo b > a
hg qnew -fgDU somestuff

echo %% applied patches in default queue
hg qap

echo %% try to change patch \(create succeeds, switch fails\)
hg qqueue foo --create
hg qqueue

echo %% empty default queue
hg qpop

echo %% switch queue
hg qqueue foo
hg qqueue

echo %% fail creating queue with already existing name
hg qqueue --create foo
hg qqueue

echo %% unapplied patches
hg qun
echo c > a
hg qnew -fgDU otherstuff

echo %% fail switching back
hg qqueue patches

echo %% fail deleting current
hg qqueue foo --delete

echo %% switch back and delete foo
hg qpop -a
hg qqueue patches
hg qqueue foo --delete
hg qqueue

echo %% tricky cases
hg qqueue store --create
hg qnew journal
hg qqueue
hg qpop -a
hg qqueue patches
hg qun

echo %% invalid names
hg qqueue test/../../bar --create
hg qqueue . --create

cd ..