test-hgignore
71 lines
| 1.2 KiB
| text/plain
|
TextLexer
/ tests / test-hgignore
|
r1478 | #!/bin/sh | ||
hg init | ||||
|
r4439 | |||
# 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 | ||||
|
r1478 | 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 | ||||
|
r2009 | echo "--" ; hg status 2>&1 | sed -e 's/abort: .*\.hgignore:/abort: .hgignore:/' | ||
|
r1478 | |||
echo ".*\.o" > .hgignore | ||||
echo "--" ; hg status | ||||
|
r6479 | # Check it does not ignore the current directory '.' | ||
echo "^\." > .hgignore | ||||
echo "--" ; hg status | ||||
|
r5029 | 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 | ||||
|
r1478 | |||
echo "syntax: invalid" > .hgignore | ||||
|
r2009 | echo "--" ; hg status 2>&1 | sed -e 's/.*\.hgignore:/.hgignore:/' | ||
|
r1478 | |||
echo "syntax: glob" > .hgignore | ||||
echo "*.o" >> .hgignore | ||||
echo "--" ; hg status | ||||
echo "relglob:syntax*" > .hgignore | ||||
echo "--" ; hg status | ||||
echo "relglob:*" > .hgignore | ||||
echo "--" ; hg status | ||||
|
r1491 | |||
cd dir | ||||
|
r1568 | echo "--" ; hg status . | ||