The hglib documentation is not very wordy about how to use it. The best is to already have your key copied and RSA fingerprint in your ~/.ssh/known_hosts
.
But you can clone a repo with:
hglib.clone(source="ssh://hg@bitbucket.org/some/project")
You can of course add destination folder (e.g. dest="/path/to/blah").
If you already have an existing hg repo cloned you can change some settings in your hgrc before trying hglib.open()
, so hg uses the ssh url like so:
[ui]
username = some_user
[paths]
default = ssh://hg@bitbucket.org/some/project
EDIT I think for hg.open to work, you have to have a repo checked out. For me I refer to the path where my repo is cloned. So:
hglib.open('/path/to/cloned/repo')
To do this over SSH you have to edit your /repopath/.hg/hgrc as mentioned above.