Mercurial set per user rights

I would like to set better user access to my mercurial repos trough the cgi web interface. This is my current hgweb.config :

[web]
contact = first.lastname
description = HG Repos
allow_push=user1,user2,user3
allow_read=user1,user2,user3
[paths]
repo01 = /home/mercurial/repo01
repo02 = /home/mercurial/repo02
repo03 = /home/mercurial/repo03
repo04 = /home/mercurial/repo04

How to setup the following ? :

  • user1 has only access (push/read) to repo01 and repo02
  • user2 has only access (read only) to repo01 and repo02
  • user3 has only access (read) to repo01 and repo02, (push/read) repo03

I've checked multiple mercurial config tutorials but nothing helped me so far.


You don't want to have the [web] section in the hgweb.config file. Instead you want to an individual [web] config in each repository, using the files

/home/mercurial/repo01/.hg/hgrc
/home/mercurial/repo02/.hg/hgrc
etc...

Myself I've found the publishing repositories wiki page to be a good tutorial.