I want to do some backup of my work on the remote machine. My first try was with hg push but it turn out that hg push require a repository to be exist on the remote end. So I just tarred up the local repo and manually copying the tarball using scp and then did an hg pull to get it back. This way I can just push my changes as a backup in the future. But something is wrong somewhere.

$ hg clone ssh://me@remotehost/home/kamal/hg/repo/
remote: abort: There is no Mercurial repository here (.hg not found)!
abort: no suitable response from remote hg!

It’s weird since doing hg log on the remote repo work just fine. So I try to execute the command with a verbose option, thank god they have it.

$ hg -v clone ssh://me@remotehost/home/kamal/hg/repo/
running ssh me@remotehost "hg -R home/kamal/hg/repo/ serve --stdio"
remote: abort: There is no Mercurial repository here (.hg not found)!
abort: no suitable response from remote hg!

That’s it. A path problem. Add another slash to the path would make it work. Then I checked back the man page and it clearly stated:-

- path is relative to the remote user’s home directory by default. Use an extra slash at the start of a path to specify an absolute path: ssh://example.com//tmp/repository

I use an absolute path because the first try using the common ‘~/’ for my home directory does not work. Next time, carefully read the manual !

Mardek (not verified) on Thu, 10/18/2007 - 13:03

Exactly what I needed.

Danke ;)

Ferdirand (not verified) on Mon, 11/05/2007 - 20:52

Hi,

Instead of tarring the local repo, you could also just have cloned it in the "push" direction with:

hg clone ./local-repo ssh://me@remotehost//home/kamal/hg/repo

or even

hg clone ./local-repo ssh://me@remotehost/hg/repo

kamal on Mon, 11/12/2007 - 09:01

Thanks Ferdirand.

However mercurial did not print any progress when I did a clone to the remote server, made me thinking that it was stalled.

Yigal (not verified) on Thu, 06/19/2008 - 22:20

I needed to clone a project today and decided to do a search on the net before attempting it myself. Thanks for saving me some time and a headache.

Rezza (not verified) on Thu, 07/24/2008 - 11:22

Uhh, double // and I thought it was typo :) Thx...