view tests/test-mq-qnew @ 9857:24bc6e414610

diff: change --inverse to --reverse This fixes an incompatibility with patch(1), which also uses --reverse for reversed diffs. The --inverse flag was added in 3f522d2fa633. That name was chosen over --reverse since it was thought that --reverse would make --rev ambiguous. It turns out that both flags can co-exist, with the cost that --rev can no longer be shortened to --r and --re. Since one can always use the short -r option, this is not a real problem.
author Martin Geisler <mg@lazybytes.net>
date Sat, 14 Nov 2009 14:21:53 +0100
parents f16ec85f125c
children 3e7663b2f3fc
line wrap: on
line source

#!/bin/sh

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

hg init mq
cd mq

echo a > a
hg ci -Ama

echo '% qnew should refuse bad patch names'
hg qnew series
hg qnew status
hg qnew guards
hg qnew .hgignore

hg qinit -c

echo '% qnew with uncommitted changes'
echo a > somefile
hg add somefile
hg qnew uncommitted.patch
hg st
hg qseries
hg revert --no-backup somefile
rm somefile

echo '% qnew implies add'
hg qnew test.patch
hg -R .hg/patches st

echo '% qnew missing'
hg qnew missing.patch missing

echo '% qnew -m'
hg qnew -m 'foo bar' mtest.patch
cat .hg/patches/mtest.patch

echo '% qnew twice'
hg qnew first.patch
hg qnew first.patch

touch ../first.patch
hg qimport ../first.patch

echo '% qnew -f from a subdirectory'
hg qpop -a
mkdir d
cd d
echo b > b
hg ci -Am t
echo b >> b
hg st
hg qnew -g -f p
cat ../.hg/patches/p

echo '% qnew -u with no username configured'
HGUSER= hg qnew -u blue red
cat ../.hg/patches/red