Mercurial API: hg.repository with https
I'm trying to write a simple script that clones an existing Mercurial kiln repository that uses https authentications. I have this snippet:
from mercurial开发者_JAVA百科 import hg, ui
repo = hg.repository(ui.ui(), "https://something.kilnhg.com/...")
Normally, whenever I would clone this repo or something, Mercurial would ask me to authenticate myself with a username and password. Instead, the above snippet just isn't getting authorized and gives me this error:
[a bunch of tracebacks...]
File "C:\Python26\lib\site-packages\mercurial\url.py", line 131, in find_user_password
raise util.Abort(_('http authorization required'))
mercurial.error.Abort: http authorization required
How can I pass my username and password to the hg.repository
function? I've looked at both the source to hg.py and ui.py, but neither were helpful.
You could try setting those directly to the url.
https://username:password@something.kilnhg.com/...
精彩评论