问题
I want to allow pushing to the default branch only for certain users. Since Kallithea does not have this functionality built in my attempt was creating a hook that should provide that behavior. I know that Kallithea has a GUI for this but I wanted to use built in mercurial functionality and hgrc file in the repository.
I have a hook defined in .hg/hgrc file in a repository that is served through Kallithea SCM
[extensions]
acl =
[hooks]
pretxnchangegroup.acl = python:hgext.acl.hook
[acl]
sources = push
[acl.allow.branches]
default = myuser
This setting should allow push rights to default branch ONLY for 'myuser' but that is not happening. I'm not sure if the hook is not set up correctly or is Kallithea just skipping hooks defined in .hg/hgrc
回答1:
It's not clear how are you expecting this to work. I don't know much about acl
extension, but I doubt it knows anything about Kallithea and its users, so I don't think it's going to work like this. I'd rather write a custom Python hook calling out to Kallithea to authorise users.
来源:https://stackoverflow.com/questions/37326906/kallithea-does-not-use-hooks-defined-in-hg-hgrc