Mercurial Acl Extension拒绝某些文件的提取 [英] Mercurial Acl Extension deny pull of some files

查看:72
本文介绍了Mercurial Acl Extension拒绝某些文件的提取的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新的商业用户.我设置了acl扩展名,将其添加到我的hgrc文件中:

I'm new mercurial user. I setup the acl extension adding this into my hgrc file:

[hooks]
pretxnchangegroup.acl = python:hgext.acl.hook

[acl]
sources = serve pull push

[acl.deny]
** = mercurial

因此,使用上面的代码,我拒绝用户"mercurial"访问所有文件.我已经成功测试了acl扩展名,并且当我尝试推送到上面放置了代码的中央存储库时,它可以完美地工作.不出所料,我收到消息,拒绝用户"Mercurial"的访问.

So with this code above I deny access to all files to user "mercurial". I successfully tested the acl extension and it works perfectly when I try to push to my central repository on which I put the code above. As expected I receive message that the access for the user "mercurial" is denied.

现在的问题是,当我从中央存储库开始拉动时,我没有任何限制,因此我可以不受限制地进行任何操作.我想要的是拒绝拉某些文件的访问权限,就像我尝试 push 命令时所做的那样.有什么办法可以做到吗?

Now the problem is when I'm start pulling from central repository I don't have any restriction so I can pull anything without any restriction. What I want is to deny pull access for some files like I can do when I tried push comand. Is there any way I can do this?

推荐答案

就像tghw的注释中所说的那样,听起来您真正想要的是通过文件路径进行部分克隆,以便一个人只能克隆或删除某些文件或目录,但这在Mercurial(或git)中是不可能的.之所以如此,是因为每个修订版均由唯一的哈希标识,其中包括所有文件更改的哈希.如果没有所有文件,则没有所有更改,也无法验证哈希.

As came out in the comments with tghw, it sounds like what you really want is partial cloning by filepath, so that a person can clone or pull down only certain files or directories, but that's not possible in Mercurial (or git). That's the case because every revision is identified by a unique hash that includes, among other things, the hash of all the file changes. If you don't have all the files, you don't have all the changes, and you can't verify the hash.

如果您确实需要对某些人隐藏某些文件的读取访问权限,则需要将其拆分为单独的存储库.

If you really need to hide read access for some files from some people you'll need to split them up into separate repositories.

这篇关于Mercurial Acl Extension拒绝某些文件的提取的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆