I’m setting up my freelance server which will be using Mercurial for all the version controlling. Each project will have it’s own folder, with it’s own repository. Which I can then clone from my home computer, work computer or any other computer by going to that particular folder.
I’m wanting to serve these repositories up into a web browser for me to browse visually when I need to. I’ve looked around and seen this: https://www.mercurial-scm.org/wiki/HgServeNginx
That looks like it’s along the right tracks, as I will be using Nginx on this server anyhow. But I’m curious to know how I would correctly set this up. What do I need to do in particular to efficiently serve up multiple repositories on my server through the web browser?
Any help or experienced insight on this would be very helpful to make sure I’m doing this correctly.
Many thanks.
Using that link, you can configure as many locations as you will have repos. In every repo directory, you need to run hg serve:
Then you can just proxy all request via nginx to that running hg servers. This is not very good way. This method need manually edit nginx config, run hg serve etc. But this method allow to you create separate auth settings for each repo. So if you plan to share repo with customer, you can easily manage this.
Instead, you can use special script, which is contributed with mercurial — hgwebdir.
Detailed info, you can fine on this page: https://www.mercurial-scm.org/wiki/PublishingRepositories#Publishing_Multiple_Repositories
UPDATE: I have mercurial version 1.6 on server, and for runnung repo web UI we use this script hgwebdir.py:
hgwebdir.conf is looks like this:
To run: nohup hgwebdir.py &, you need flup python module, so: easy_install flup
Related nginx.conf part is: