tests/test-keyword
author Christian Ebert <blacktrash@gmx.net>
Wed, 21 Feb 2007 02:27:15 +0100
branchkwmap-templates
changeset 148 c0baa881d90a
parent 131 23a1e1bdf62b
child 151 5f3856a6ce56
permissions -rwxr-xr-x
Extend test for symlink

#!/bin/sh

cat <<EOF >> $HGRCPATH
[extensions]
hgext.keyword =
[keyword]
a =
b = ignore
EOF

echo % help
hg help keyword

hg init Test
cd Test
echo 'expand $Id$' > a
echo 'ignore $Id$' > b
ln -s a sym
echo % cat
cat sym a b

echo % default keyword expansion
echo % commit
hg --debug commit -A -mabsym -d '0 0' -u 'User Name <user@example.com>'
echo % status
hg status

echo % cat
cat sym a b
echo % hg cat
hg cat sym a b

echo
rm sym a b
echo % update
hg update
echo % cat
cat sym a b

echo % custom keyword expansion
cat <<EOF >>$HGRCPATH
[keywordmaps]
Id = {file} {node|short} {date|rfc822date} {author|user}
Xinfo = {author}: {desc}
EOF

echo % cat
cat sym a b
echo % hg cat
hg cat sym a b

echo
echo '$Xinfo$' >> a
cat <<EOF >> log
firstline
secondline
EOF

echo % commit
hg --debug commit -l log -d '1 0' -u 'User Name <user@example.com>'
rm log
echo % status
hg status

echo % cat
cat sym a b
echo % hg cat
hg cat sym a b

echo
cd ..
hg clone -r0 Test Test-a
cd Test-a
cat <<EOF >> .hg/hgrc
[paths]
default = ../Test
EOF
echo % incoming
hg incoming

echo % switch off expansion
rm $HGRCPATH

cd ../Test
echo % cat
cat sym a b
echo % hg cat
hg cat sym a b

echo
echo % update
rm sym a b
hg update

echo % cat
cat sym a b