[PATCH] ui.username(): expand environment variables in username configuration value

Martin Geisler mg at aragost.com
Thu May 27 03:39:33 CDT 2010


Chad Dombrova <chadrik at gmail.com> writes:

> # HG changeset patch
> # User Chad Dombrova <chadrik at gmail.com>
> # Date 1274907809 25200
> # Branch stable
> # Node ID ebf02a667205db330bda984d832c5799f6a29c9f
> # Parent  23b20efd76df212a8d1ac4b07e1493dfc576f9bf
> ui.username(): expand environment variables in username configuration value.

In crew as d6dbd5e4ee72, thanks!

> 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.

BTW, this is yet another reason for us to register our configuration
options in code -- that would allow us to put a flag on each option to
say if we should do tilde and environment variable expansion.

> diff -r 23b20efd76df -r ebf02a667205 tests/test-hgrc
> --- 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"
> +FAKEUSER='John Doe'
> +export FAKEUSER
> +echo "[ui]" > $HGRCPATH
> +echo "username=\$FAKEUSER" >> $HGRCPATH
> +unset FAKEPATH

I deleted the above stray line and moved some other things around a bit
in the tests.

-- 
Martin Geisler

aragost Trifork
Professional Mercurial support
http://aragost.com/mercurial/


More information about the Mercurial-devel mailing list