view tests/test-hgignore @ 5483:0c43f87baba3 default tip

Fix file-changed-to-dir and dir-to-file commits (issue660). Allow adding to dirstate files that clash with previously existing but marked for removal. Protect from reintroducing clashes by revert. This change doesn't address related issues with update. Current workaround is to do "clean" update by manually removing conflicting files/dirs from working directory.
author Maxim Dounin <mdounin@mdounin.ru>
date Sat, 27 Oct 2007 16:27:55 +0400
parents ac97e065cfc7
children
line wrap: on
line source

#!/bin/sh

hg init

# Test issue 562: .hgignore requires newline at end
touch foo
touch bar
touch baz
cat > makeignore.py <<EOF
f = open(".hgignore", "w")
f.write("ignore\n")
f.write("foo\n")
# No EOL here
f.write("bar")
f.close()
EOF

python makeignore.py
echo % should display baz only
hg status
rm foo bar baz .hgignore makeignore.py

touch a.o
touch a.c
touch syntax
mkdir dir
touch dir/a.o
touch dir/b.o
touch dir/c.o

hg add dir/a.o
hg commit -m 0
hg add dir/b.o

echo "--" ; hg status

echo "*.o" > .hgignore
echo "--" ; hg status 2>&1 | sed -e 's/abort: .*\.hgignore:/abort: .hgignore:/'

echo ".*\.o" > .hgignore
echo "--" ; hg status

echo "glob:**.o" > .hgignore
echo "--" ; hg status

echo "glob:*.o" > .hgignore
echo "--" ; hg status

echo "syntax: glob" > .hgignore
echo "re:.*\.o" >> .hgignore
echo "--" ; hg status

echo "syntax: invalid" > .hgignore
echo "--" ; hg status 2>&1 | sed -e 's/.*\.hgignore:/.hgignore:/'

echo "syntax: glob" > .hgignore
echo "*.o" >> .hgignore
echo "--" ; hg status

echo "relglob:syntax*" > .hgignore
echo "--" ; hg status

echo "relglob:*" > .hgignore
echo "--" ; hg status

cd dir
echo "--" ; hg status .