2

I have Mercurial running on my machine, and I want to keep a master repository on a machine that I access over SSH. The machine where I want to keep the master repository does not have Mercurial installed, and I cannot install it. I tried to create the repository on the remote machine using hg push, and I got a message about the remote machine not having Mercurial installed:

$ hg push ssh://user@exaple.com/repo
user@exaple.com's password: 
remote: bash: hg: command not found
abort: no suitable response from remote hg!

I there any way I can make Mercurial treat this SSH url like a filesystem location and clone to it instead? Once it's set up, how can I push to it without relying on a remote copy of Mercurial?

flag
Is there a reason you can't install Mercurial on the remote server? – Benjamin Pollack Sep 22 2010 at 16:25

2 Answers

2

There is no way that Mercurial can push or clone to a machine without Mercurial installed. The good news is that, as long as you're just using it for backup purposes, and no one else will ever be pushing there, you can safely rsync up to the remote host. Just remember that doing so will have no repository locking, so trying to rsync from two machines at once will leave you very unhappy.

(Useless trivia: As it happens, very, very early versions of Mercurial could in fact do this, if I recall correctly, but what they did was exactly equivalent to running rsync, which is why the feature was removed. I think that Bazaar still has this functionality, if you badly need a DVCS that can push to machines without the DVCS installed, but I don't know of any other system that can. Really, if you're just doing it for backup, rsync works just fine.)

link|flag
0

You can use sshfs to literally make ssh look like a filesystem.

link|flag
While this can work, you should be aware that, the way sshfs works, your locks won't do anything meaningful, so this is functionally equivalent to using rsync. – Benjamin Pollack Sep 22 2010 at 16:24

Your Answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.