tests/test-mq-qnew
author Augie Fackler <durin42@gmail.com>
Sun, 07 Feb 2010 07:37:05 -0600
changeset 10372 27d542bc0f5b
parent 10114 3e7663b2f3fc
child 10397 8cb81d75730c
permissions -rwxr-xr-x
qnew: ignore force option This makes the default behavior the same as qnew --force, and deprecates the force option.

#!/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

echo '% qnew implies add'
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

echo '% fail when trying to import a merge'
hg init merge
cd merge
touch a
hg ci -Am null
echo a >> a
hg ci -m a
hg up -r 0
echo b >> a
hg ci -m b
hg merge -f 1
hg resolve --mark a
hg qnew -f merge

exit 0