tests/test-keyword
author Christian Ebert <blacktrash@gmx.net>
Sat, 24 Feb 2007 11:10:31 +0100
branchkwmap-templates
changeset 149 0c8b7e5c25a6
parent 148 c0baa881d90a
child 151 5f3856a6ce56
permissions -rwxr-xr-x
Implement archive mode by configuration Note: For some reason commands.parse(ui, sys.argv[1:]) breaks "hg diff -r".

#!/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