views:

4074

answers:

3

I can't clone my repository via http:

abort: 'http://MYREPO' does not appear to be an hg repository!

Firstly, I created a new repo by hg init MYREPO followed by adding some file and commit.

The dir with my repo is password protected but there is no sign of problem because of it, I tried both methods of cloning: (on my local machine)

hg clone http://MYREPO my_repo

and

hg clone http://user:password@MYREPO my_repo

Permissions of repo dir are: drwxrwxr-x

I can clone this very repository on my remote machine (the same repo is on) without any problems.

What could be possibly wrong?

+5  A: 

UPDATE:

Looks like you're getting confusing between repository and hostname

If running "hg serve", "hg clone http://USER@HOST:8000" where host can be you machine's IP or the hostname (type "hostname" on linux or try "ping localhost"). You can change the default port from 8000 by passing a --port #### to hg serve.

If you want to do it over ssh, "hg clone ssh://USER@HOST//PATH/TO/YOUR/REPOSITORY". Suppose you made an repository in your home directory called MYREPO then you would do this: "hg clone ssh://USER@HOST/~/MYREPO"

You can only clone your repo via http is something is serving that repo over http. Mercurial provides a built in http server for you. Run "hg serve" while inside of your repo then attempt to clone it from another location (or another command shell). If you just want a local clone, you don't need to use http ("hg clone ").

Also, try "hg help clone" and "hg help serve" for details.

basszero
A: 

besszero is right, but why don't you clone using SSH if you are gonna use username and password anyway?

hg clone ssh://machine_ip//your/repo/location your_repo

It's also safer if you don't want to open another port for mercurial's http server and you don't need the hgweb features, the traffic is also encrypted. The only con is that you have to log in to checkout, but HTTP doesn't work for pushing back the changes, at least not in my experience.

cyborg_ar
It does work with push_ssl = false in your hgrc
piobyz
A: 

Argh... One need to be careful with .htaccess configuration. In my case I needed to add 'hgwebdir.cgi' to the path to clone... Thanks for the answers though!

SSH seems logical but somehow I couldn't use it with user other than my local:

hg clone ssh://MY_REMOTE_USER@MYREPO remote: abort: There is no Mercurial repository here (.hg not found)!

piobyz