view tests/test-mq-symlinks @ 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 d08099e74b81
children 8cb81d75730c
line wrap: on
line source

#!/bin/sh

"$TESTDIR/hghave" symlink || exit 80

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

hg init
hg qinit
hg qnew base.patch
echo aaa > a
echo bbb > b
echo ccc > c
hg add a b c
hg qrefresh
$TESTDIR/readlink.py a

echo '% test replacing a file with a symlink'
hg qnew symlink.patch
rm a
ln -s b a
hg qrefresh --git
$TESTDIR/readlink.py a

hg qpop
hg qpush
$TESTDIR/readlink.py a

echo '% test updating a symlink'
rm a
ln -s c a
hg qnew --git -f updatelink
$TESTDIR/readlink.py a
hg qpop
hg qpush --debug
$TESTDIR/readlink.py a
hg st

echo '% test replacing a symlink with a file'
ln -s c s
hg add s
hg qnew --git -f addlink
rm s
echo sss > s
hg qnew --git -f replacelinkwithfile
hg qpop
hg qpush
cat s
hg st

echo '% test symlink removal' 
hg qnew removesl.patch
hg rm a
hg qrefresh --git
hg qpop
hg qpush
hg st -c