If you are behind a firewall and you need to access a proxy server to connect, even if you had set the http_proxy environment variable properly, you still get:
$ hg clone https://xenbits.xensource.com/xen-unstable.hg
abort: error: Name or service not known
The Mercurial (hg) does not get the proxy setting from the environment. Instead you can set it up in the $HOME/.hgrc file:
[http_proxy]
host=<your_proxy_server>:<your_proxy_port>
and you will be able to proceed with the hg operations.