在我的mercurial项目中,我有一些用户可以克隆存储库,但我需要他们只能看到一些分支。
例如,他们只能看到“稳定”分支,所以我可以肯定他们永远不会尝试不稳定的代码。 或者客户X只能看到他的自定义分支。
我知道我可以提取发布的源代码并将其提供给他们。但出于“非技术”原因,他们希望访问存储库。
有可能吗?
谢谢, 马里奥
答案 0 :(得分:3)
您可以使用[acl.deny.branches]
和[acl.allow.branches]
来定义 [hooks]
# Use this if you want to check access restrictions at commit time
pretxncommit.acl = python:hgext.acl.hook
# Use this if you want to check access restrictions for pull, push,
# bundle and serve.
pretxnchangegroup.acl = python:hgext.acl.hook
[acl]
# Check whether the source of incoming changes is in this list where
# "serve" == ssh or http, and "push", "pull" and "bundle" are the
# corresponding hg commands.
sources = serve
[acl.groups]
# If a group name is not defined here, and Mercurial is running under
# a Unix-like system, the list of users will be taken from the OS.
# Otherwise, an exception will be raised.
designers = user1, user2
[acl.deny.branches]
# Everyone is denied to the frozen branch:
frozen-branch = *
# A bad user is denied on all branches:
* = bad-user
[acl.allow.branches]
# A few users are allowed on branch-a:
branch-a = user-1, user-2, user-3
# Only one user is allowed on branch-b:
branch-b = user-1
# The super user is allowed on any branch:
* = super-user
# Everyone is allowed on branch-for-tests:
branch-for-tests = *
。
以下示例配置来自ACL文档页面。
{{1}}