environment variable for host in [http_proxy] section not working?

Kevin Bullock kbullock+mercurial at ringworld.org
Fri Apr 12 22:06:00 UTC 2013


On Apr 11, 2013, at 1:48 PM, Will Fiveash wrote:

> I did the following:
> 
> 1. $ export  MY_PROXY=http://foo.com:80/
> 
> 2. edit ~/.hgrc:
> [http_proxy]
> host = $MY_PROXY
> 
> 3. $ hg incoming
> abort: error: node name or service name not known
> 
> If I set host like so in .hgrc:
> 
> [http_proxy]
> host = http://foo.com:80/
> 
> then hg incoming works.  I'm running Mercurial Distributed SCM (version 2.2.1) on Solaris 11u1.  Is this a bug?

Nope, environment variables are only expanded in specific config settings in hgrc. Generally speaking, only when the value is a username or filename.

You can set config options directly from the command line, though. E.g.:

  $ hg incoming --config http_proxy.host=http://foo.com:80/

I think hg also respects the 'http_proxy' environment variable.

pacem in terris / мир / शान्ति / ‎‫سَلاَم‬ / 平和
Kevin R. Bullock




More information about the Mercurial mailing list