"hg clone git+http://foo" cannot send HTTP auth credentials
Created originally on Bitbucket by muxator
I'm trying to clone against a git repository which is exposed in HTTP and requires a basic authentication.
Not willing to modify the clone URL (more on this later), I configured my credentials in /etc/mercurial/hgrc
#!ini
[auth]
foo.prefix = git+http://hostname
foo.username = myuser
foo.password = mypwd
but when doing:
#!bash
hg clone git+http://hostname
HTTP credetials do not get read from hgrc (and do not get sent: verified with strace -e network).
On the other hand:
#!bash
hg clone git+http://myuser@hostname
gives "abort: error: Name or service not known" (the url parsing phase fails), while:
#!bash
hg clone git+http://myuser:mypwd@hostname
fails even worse, throwing "httplib.InvalidURL: nonnumeric port: 'mypwd@hostname'"
Do exist a way to pass HTTP credentials when cloning from a git repo?
Edited by Dan Villiom Podlaski Christiansen