Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We will need to host a series of Mercurial repositories. For security, we will use SSL encryption in Apache and htpasswd access (required). I tested out a single repository and used hgwebdir.cgi and used the hgweb.config to define the repository path and the allow_push and deny_push directives, but this test setup has only lead to more questions/problems:

I don't see any way to make a different allow/deny push group for each separate repository? ore importantly, I see no method to allow_pull deny_pull — which is quite important as each repository has a different set of users who should be allowed to read or write. We'd like to keep one htpasswd file for all users.

share|improve this question
add comment

3 Answers 3

up vote 5 down vote accepted

I think what you are likely missing is that it is perfectly allowable to create a .hg/hgrc file inside each repository, and those files can contain allow_push and allow_read entries.

share|improve this answer
    
In addition, you also have deny_push and deny_read. So you can choose a whilelist/blacklist/mix approach. –  Laurent Etiemble Dec 15 '09 at 12:40
add comment

Mercurial-server is a great way to host many Mercurial repos with different access requirements per repos.

If you decide this is not for you then you should take a look at the ACL extension to Mercurial.

share|improve this answer
    
Please note that mercurial-server is a third-party tool. It is not needed for maintaining a Mercurial server, though it can be a convenient way to do so when using SSH for access control. –  Martin Geisler Dec 18 '11 at 10:38
add comment

I think the best way to allow_pull or deny_pull is to set up httpd authentication using the htpasswd file. You could use any of the mod_auth mechanisms here to allow each user to pull or push.

You might also look into using the SSH transport for hosting as that will give you a finer grained control over access, at the cost of a slightly more complicated setup.

More info can be found in the Mercurial wiki.

share|improve this answer
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.