tests/test-keyword
branchkwmap-templates
changeset 121 85ed7d71ba0f
child 131 23a1e1bdf62b
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-keyword	Tue Jan 23 15:26:33 2007 +0000
@@ -0,0 +1,75 @@
+#!/bin/sh
+
+cat <<EOF >> $HGRCPATH
+[extensions]
+hgext.keyword =
+[keyword]
+* =
+b* = ignore
+EOF
+
+echo % help
+hg help keyword
+
+hg init a
+cd a
+echo '$Id$' > a
+echo '$Id$' > b
+echo % cat
+cat a b
+
+echo % default keyword expansion
+echo % commit
+hg --debug commit -A -m ab -d '0 0' -u 'User Name <user@example.com>'
+
+echo % cat
+cat a b
+echo % hg cat
+hg cat a b
+
+rm a b
+echo % update
+hg update
+echo % cat
+cat 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 a b
+echo % hg cat
+hg cat a b
+
+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>'
+
+echo % cat
+cat a b
+echo % hg cat
+hg cat a b
+
+echo % switch off expansion
+rm $HGRCPATH
+
+echo % cat
+cat a b
+echo % hg cat
+hg cat a b
+
+echo % update
+rm a b
+hg update
+
+echo % cat
+cat a b