Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

What specific steps to I need to take to set it up?

Do I need special post-commit hooks to update the remote copy of the site?

Do I need SSH access to the remote server?

I'm looking for a setup where I can push the changes to the remote repository and the changes will be published to the website.

share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

You can configure Mercurial to run a web server using the hg serve command. A list of runtime options on hg serve are available here.

Once you have your web server set up, hg clone http://servername:port will pull a copy of the server's resources, and hg push from that directory will update the server.

To force the server to update itself upon receiving a new push, add the following to the .hg/hgrc file in the repository:

[hooks]
changegroup = hg update >&2

This should accomplish what you're looking for.

share|improve this answer
    
Wow... thank you so much. I think I searched google for 4 hours and still couldn't find a good answer to this question. –  Evan Plaice Jul 8 '10 at 22:11
    
My pleasure! :) It took me a lot of searching to figure this out, too. –  Soleil Jul 8 '10 at 22:16
    
one other question. Would I still need to install mercurial on the remote server over SSH? –  Evan Plaice Jul 9 '10 at 9:25
    
SSH or at the console directly, yes. –  Soleil Jul 9 '10 at 14:10
    
I'm going to modify one of my tutorials to include your last suggestion, with proper attribution of course :) –  Tim Post Jul 13 '10 at 2:16
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.