How to control file permissions in CVS repository?

只愿长相守 提交于 2019-12-06 12:42:57
zhrist

Cvs command option watch is also preventing file permissions to be restored. If watched, when file is checked out it will be read-only. From cvs man pages:

$ cvs watch --help_options

Usage: cvs watch {on|off|add|remove} [-lR] [-a <action>]... [<path>]...

on/off: turn on/off read-only checkouts of files

So, use cvs watch off filename to remove checkout from repository making it read only every time.

koral

I am not sure if this is the best solution, but I would probably do something with the cvswrappers file in CVSROOT directory of the repo, using commitinfo, commitcheck and commit_prep.pl. If you don't have commit_prep.pl, you can use something like this one:

http://opensource.apple.com/source/cvs/cvs-29/cvs/contrib/commit_prep.pl

There are quite a few examples on the web, so just search for those commit* files if you don't already have those in your repo.

Note that, as this post suggests, the permission is really set only during the first commit of a file, after that, you'd need to "manually" modify the permission on the repository itself.

How do I add execute permission to a file in CVS after it's already been checked in?

In commit_prep.pl, you can clear the exec permission using chmod ugo-x , before the file is committed for the first time.

This solution assumes you are using linux.

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