开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜