Kallithea does not use hooks defined in .hg/hgrc

青春壹個敷衍的年華 提交于 2019-12-12 03:39:33

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!