Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I use ToroiseHg Workbench to manage repositories on my local windows machine, and I like how TortoiseHg composes the commands based on clicks I make using the GUI.

But I only know how to use TortoiseHg to manage local windows repositories, not remote unix Mercurial clients residing on a web server.

Is it possible to tunnel through SSH and send commands to a unix web server? I would like to manage a repo remotely on my web server using TortoiseHg.

share|improve this question
    
The usual way of working with DVCS repositories is to hg clone the repo to your computer, then hg push new commits back to the server. –  grawity Aug 20 '12 at 23:14
    
I use bitbucket to store the repos, and I want to pull the latest commits from bitbucket to the web server. Do I need to pull using the web server's command line, or is there a way to send commands to my web server from TortoiseHg's windows client? Filezilla sends commands to be executed on the server. –  steampowered Aug 21 '12 at 2:19
add comment

1 Answer

up vote 1 down vote accepted

No, this is not possible: the only "commands" you can send over SSH (and HTTPS) are hg push and hg pull.

They're not really sent as "commands", instead Mercurial uses it's own protocol which allows a client to query a remote server for a few things like "do you have this changeset?", "what are the branch heads?", and "please accept this bundle!".

When you use SSH, your Mercurial client will make a SSH tunnel and start hg serve --stdio on the remote host. That hg serve command is what speaks the Mercurial wire protocol I talk about above. Hosting environments such as Bitbucket are locked down so that this is the only command you can execute over SSH — they don't want you to execute arbitrary commands on their servers!

As for managing a remote repository on your own webserver: You need to login with SSH and create an empty repository on your Unix server:

$ hg init my-website

Then you can push to the server from your local machine:

$ hg push ssh://your-server.com/path/from/home-dir/to/my-website

Since you're talking about managing a website, you might want to add

[hooks]
changegroup = hg update

to the .hg/hgrc file in the remote repository: it will make Mercurial run hg update after every push into that repository. This means that the working copy will be updated with the latest files and so your webserver can serve these to the world.

share|improve this answer
    
Ok, thanks. Looks like I'll need to script on the command line to pull and updates to the server. Not a huge deal to script, just wanted to make sure there was no way to use TortoiseHg. –  steampowered Aug 21 '12 at 16:49
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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