I can successfully access repositories over http:// using hgweb.cgi:
$ hg clone http://mydomain.com/scgi-bin/hgweb.cgi/myrepo
I can also successfully ssh into mydomain.com using a password.
$ ssh myname@mydomain.com
myname@mydomain.com's password: xxxxxx
Last login: Sat Jun 9 .....
myname@mydomain.com [~]# ls public_html/scgi-bin
./ ../ hgweb.cgi*, hgweb.config
However I can’t deduce how to serve repositories via SSH. For example, this doesn’t work:
$ hg clone ssh://myname@mydomain.com/public_html/scgi-bin/hgweb.cgi/myrepo
myname@mydomain.com's password: xxxxx
remote: stdin: is not a tty
remote: bash: hg: command not found
abort: no suitable response from remote hg!
I’m concluding that unlike http://, ssh:// doesn’t know how to run the cgi script, would that be correct? Is there a solution to this?
(btw: this is on shared hosting, where http’s root is public_html/, ssh’s root is one directory up.)
HTTP is not the same as SSH. HTTP is a stateless, request-based transmission protocol. SSH is a protocol which establishes a permanent, stateful connection between two machines.
Your HTTP URL looks like a full path to a repository, but it goes through a web server, which is executing the hgweb.cgi script, passing it myrepo as an argument. The hgweb.cgi script runs Mercurial on the server against the myrepo repository (it pulls the actual location from a config file on the server). The command chain looks like this:
The SSH URL you’re using in the second example tells Mercurial to log into the
mydomain.comserver asmyname, and it can find the repository at/public_html/scgi-bin/hgweb.cgi/myrepo. Most likely, that isn’t where your repo is at. The command chain looks like this:You need to change your SSH URL to use the absolute path to the repo on the server:
It also looks like the server can’t find the Mercurial executable.