I'd like to use mercurial on a Windows server. Since I want to pull and push via http, hg serve
seems the easiest solution. It works fine, but I have restart it after each reboot, so I need it as a Windows service. Installing it manually with sc create ...
didn't work, it created a service that throws an error when I attempt to start it. I found some references to this problem
but they are poorly documented if at all. (Of course, I could install a web server and use hgweb, but it seems even more complicated.) Do you have any experience how to set up easily hg serve ... <many args>
as a Windows service?
UPDATE:
Thanks for the different approaches. We stayed with hg serve
, the windows-guy at our company managed to install it as a not-quite-proper service.
Using a web server such as apache/lighttpd/iis gives a lot of features such as authentication or HTTPS support. But 'hg serve' is a simple and fast solution. Furthermore, 'hg serve' can serve multiple repositories. But hg serve cannot itself be run as a Windows service because it cannot respond to the Windows control commands. So using HgService is a good solution to make 'hg serve' a real Windows service.
Here is an example of my configuration. I followed following steps:
[paths]
/ = C:\Repositories\*
[web]
style = monoblue
<add key="CommandLine" value="hg.exe"/>
<add key="CommandLineArguments" value="serve --prefix=/hg --address 0.0.0.0 --port 80 --web-conf c:\Repositories\hgweb.config -A access.log -E error.log" />
Hope this sequence of action will be helpful to you also.
Or you could use the SCM-Manager
You should check out Jerremy Skinner his blogpost on this subject. He explains how you can host Mercurial repositories on IIS7 and use some nice url-routing. I did it on my machine and it works like a charm. It takes some configuration, but it's worth it.
1 error in his post I noticed was that he's writing about a hgwebdir.cgi, but I couldn't find that one. I did find a hgweb.cgi, so did the copy-pasting with this file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With