tests/test-tag
author Martin Geisler <mg@lazybytes.net>
Sun, 04 Oct 2009 22:03:41 +0200
changeset 10443 62d484a81dfe
parent 8417 39cf453da958
child 11063 eb23c876c111
permissions -rwxr-xr-x
minirst: support containers Text can be grouped into generic containers in reStructuredText: .. container:: foo This is text inside a "foo" container. .. container:: bar This is nested inside two containers. The minirst parser now recognizes these containers. The containers are either pruned completely from the output (included all nested blocks) or they are simply un-indented. So if 'foo' and 'bar' containers are kept, the above example will result in: This is text inside a "foo" container. This is nested inside two containers. If only 'foo' containers are kept, we get: This is text inside a "foo" container. No output is made if only 'bar' containers are kept. This feature will come in handy for implementing different levels of help output (e.g., verbose and debug level help texts).

#!/bin/sh

hg init test
cd test

echo a > a
hg add a
hg commit -m "test" -d "1000000 0"
hg history
hg tag -d "1000000 0" "bleah"
hg history

echo foo >> .hgtags
hg tag -d "1000000 0" "bleah2" || echo "failed"

hg revert .hgtags
hg tag -d "1000000 0" -r 0 x y z y y z || echo "failed"
hg tag -d "1000000 0" tap nada dot tip null . || echo "failed"
hg tag -d "1000000 0" "bleah" || echo "failed"
hg tag -d "1000000 0" "blecch" "bleah" || echo "failed"

hg tag -d "1000000 0" --remove "blecch" || echo "failed"
hg tag -d "1000000 0" --remove "bleah" "blecch" "blough" || echo "failed"

hg tag -d "1000000 0" -r 0 "bleah0"
hg tag -l -d "1000000 0" -r 1 "bleah1"
hg tag -d "1000000 0" gack gawk gorp
hg tag -d "1000000 0" -f gack
hg tag -d "1000000 0" --remove gack gorp

cat .hgtags
cat .hg/localtags

hg update 0
hg tag -d "1000000 0" "foobar"
cat .hgtags
cat .hg/localtags

hg tag -l 'xx
newline'
hg tag -l 'xx:xx'

echo % cloning local tags
cd ..
hg -R test log -r0:5
hg clone -q -rbleah1 test test1
hg -R test1 parents --style=compact
hg clone -q -r5 test#bleah1 test2
hg -R test2 parents --style=compact
hg clone -q -U test#bleah1 test3
hg -R test3 parents --style=compact

cd test
echo % issue 601
python << EOF
f = file('.hg/localtags'); last = f.readlines()[-1][:-1]; f.close()
f = file('.hg/localtags', 'w'); f.write(last); f.close()
EOF
cat .hg/localtags
hg tag -l localnewline
cat .hg/localtags

python << EOF
f = file('.hgtags'); last = f.readlines()[-1][:-1]; f.close()
f = file('.hgtags', 'w'); f.write(last); f.close()
EOF
hg ci -d '1000000 0' -m'broken manual edit of .hgtags'
cat .hgtags
hg tag -d '1000000 0' newline
cat .hgtags