diff tests/test-hgrc @ 11225:d6dbd5e4ee72

ui.username(): expand environment variables in username configuration value. note: expansion of config variables must be handled on a case-by-case basis because they can contain arbitrary data that may not be desirable to expand.
author Chad Dombrova <chadrik@gmail.com>
date Wed, 26 May 2010 14:03:29 -0700
parents f23f87462c18
children
line wrap: on
line diff
--- a/tests/test-hgrc	Wed May 26 14:03:29 2010 -0700
+++ b/tests/test-hgrc	Wed May 26 14:03:29 2010 -0700
@@ -29,6 +29,28 @@
 hg version 2>&1 | sed -e "s|$HGRCPATH|\$HGRCPATH|"
 unset FAKEPATH
 
+echo "% username expansion"
+olduser=$HGUSER
+unset HGUSER
+
+FAKEUSER='John Doe'
+export FAKEUSER
+echo '[ui]' > $HGRCPATH
+echo 'username = $FAKEUSER' >> $HGRCPATH
+
+hg init usertest
+cd usertest
+touch bar
+hg commit --addremove --quiet -m "added bar"
+hg log --template "{author}\n"
+cd ..
+
+hg showconfig | sed -e "s:$p:...:"
+
+unset FAKEUSER
+HGUSER=$olduser
+export HGUSER
+
 # HGPLAIN
 cd ..
 p=`pwd`