I want to restrict certain users from pushing changesets to the default branch of a repository. If it is possible, how would you do it?
The ACL extension should work for you. However, you need to take into account the following considerations:
The extension must be enabled in the server repositories. That is, the hgrc
file of each served repository should have ACL settings defined:
[extensions]
acl =
[hooks]
pretxnchangegroup.acl = python:hgext.acl.hook
[acl]
sources = serve
[acl.deny.branches]
default = user1, user2, user3
These users that have push denied are system users. That is, the username is taken from the credentials provided by the web server in your case. It has nothing to do with the Author:
field in the commit metadata.
You could also write your own pretxnchangegroup
hook but you will not be much more capable than the ACL extension.