Reproducible with 2.1.1 on OS X and Debian Squeeze. Other environment variables seem to be expanded properly. [fms@levo] ~:pts/1 % hg --config 'ui.username=$HOST' showconfig|grep user smtp.username=fsiler@gmail.com trusted.users=fms ui.username=$HOST [fms@levo] ~:pts/1 % hg --version Mercurial Distributed SCM (version 2.1.1) (see http://mercurial.selenic.com for more information) Copyright (C) 2005-2012 Matt Mackall and others This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. [fms@levo] ~:pts/1 % uname -a Linux levo 2.6.32-5-amd64 #1 SMP Thu Mar 22 17:26:33 UTC 2012 x86_64 GNU/Linux
Interesting: bug is more expansive when using --config instead of in config file. $USER, $TZ, et al are expanded when ui.username is specified in config file, but on command line, hg does not expand any variables.
Variable expansion is only done when config value are used (not for display). Your test below is inconclusive.
~/.hgrc: [ui] username = Franklin Siler <fms@silerfamily.net> (from $USER on $HOST) Below- commit header as it appears in $EDITOR: HG: Enter commit message. Lines beginning with 'HG:' are removed. HG: Leave message empty to abort commit. HG: -- HG: user: Franklin Siler <fms@silerfamily.net> (from fms on $HOST)
Consult "env | grep HOST", please.
another example header with .hgrc: [ui] username = Franklin Siler <fms@silerfamily.net> (from $USER on $HOST in $PWD, editor $EDITOR, timezone $TZ) sample commit header: HG: Enter commit message. Lines beginning with 'HG:' are removed. HG: Leave message empty to abort commit. HG: -- HG: user: Franklin Siler <fms@silerfamily.net> (from fms on $HOST in /Users/fms, editor vim, timezone America/Chicago)
--- Bug imported by bugzilla@serpentine.com 2012-05-12 09:29 EDT --- This bug was previously known as _bug_ 3341 at http://mercurial.selenic.com/bts/issue3341