开发者

Possible to use a different set of hooks for a user or group in Mercurial?

开发者 https://www.devze.com 2023-03-01 03:51 出处:网络
I am not sure if this is possible currently but is it possible to specify a separate set of hooks for a user or group (groups from the ACL extension).

I am not sure if this is possible currently but is it possible to specify a separate set of hooks for a user or group (groups from the ACL extension).

I know you can specify the hooks on each user's machine individually but I would like to also place the hooks on the central repo (so that those hooks are ran when they push).

For exa开发者_StackOverflowmple

say I have hooks for group A

[hooks]
pretxngroupchange.A=python:Group-A-hook.py:hook

for all of group A

and

[hooks]
pretxngroupchange.B=python:Group-B-hook.py:hook

If someone from group A pushes, I don't want the hooks for group B to be triggered

Is this possible? Even if I can't do it by groups (which I think Mercurial should pick up Os-level groups), is it possible for Hg to run it per user?


You could use a single script which looks up users by name and performs a different activity based on the user. In order to avoid having to update the script for new users, you could revision a user list in an Hg repo and read the latest version of the repo inside this hook.

I'm not sure that this qualifies as a "good idea", but it might work if you can't find another solution.

0

精彩评论

暂无评论...
验证码 换一张
取 消