view tests/test-symlinks @ 4074:0f9381cf9723

Try to pass repo.ui to reposetup hooks The ui object we received in this function may belong to another repo, which could be confusing from the hook point of view. Trying to use the ui object from the newly created repo should avoid this confusion.
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Thu, 08 Feb 2007 16:31:21 -0200
parents 9dcf9d45cab8
children 26596a6b6518
line wrap: on
line source

#!/bin/sh
#Test bug regarding symlinks that showed up in hg 0.7
#Author: Matthew Elder <sseses@gmail.com>

#make and initialize repo
hg init test; cd test;

#make a file and a symlink
touch foo; ln -s foo bar;

#import with addremove -- symlink walking should _not_ screwup.
hg addremove

#commit -- the symlink should _not_ appear added to dir state
hg commit -m 'initial'

#add a new file so hg will let me commit again
touch bomb

#again, symlink should _not_ show up on dir state
hg addremove

#Assert screamed here before, should go by without consequence
hg commit -m 'is there a bug?'

cd .. ; rm -r test
hg init test; cd test;

mkdir dir
touch a.c dir/a.o dir/b.o
# test what happens if we want to trick hg
hg commit -A -m 0
echo "relglob:*.o" > .hgignore
rm a.c
rm dir/a.o
rm dir/b.o
mkdir dir/a.o
ln -s nonexist dir/b.o
mkfifo a.c
# it should show a.c, dir/a.o and dir/b.o deleted
hg status
hg status a.c

echo '# test absolute path through symlink outside repo'
cd ..
p=`pwd`
hg init x
ln -s x y
cd x
touch f
hg add f
hg status $p/y/f

echo '# try symlink outside repo to file inside'
ln -s x/f ../z
# this should fail
hg status ../z && { echo hg mistakenly exited with status 0; exit 1; } || :