From BladerHQ

FileServer: Mercurial

Short notes on my Mercurial installation.

I basically followed the instructions on HgWebDirStepByStep and ended up with the following:

In /etc/apache2/sites-enabled/default-ssl I added

        ScriptAliasMatch ^/hg(.*) "/var/www/hg/hgwebdir.cgi$1"
        <Directory "/var/www/hg">
                AuthType Basic
                AuthName "Mercurial repositories"
                AuthUserFile /var/www/hg/hgusers
                Require valid-user
                Options ExecCGI FollowSymLinks
                AllowOverride None
        </Directory>

My users are specified in /home/repo/hg/hgusers

user1:$ajlhgvlihasbdhgbw7hgEJO.
guest:u883hCsadddCs

To add another user you can do the following:

htpasswd /home/repo/hg/hgusers another_user

The last two lines of hgwebdir.cgi looks like this

application = hgwebdir('hgweb.config')
wsgicgi.launch(application)

The hgweb.config looks like this

[paths]
proj1 = /var/www/hg/repos/proj1/
proj2 = /var/www/hg/repos/proj2/

[web]
style =
allow_archive = gz zip
contact = Master, master@universe.se
allow_push = user1
push_ssl = false

The repositories are inside the proj1 and proj2 directories, and each repository have its own configuration, i.e. repos/proj1/.hg/hgrc contains the following

[web]
description = This contains my proj1 files.
allow_push = user2
allow_read = user2

When the above was done I could restart apache and access the repo at:

https://www.yourserver.com:8443/hg/

Retrieved from http://wiki.bladerhq.com/FileServer/Mercurial

Page last modified on October 29, 2012, at 10:00 PM