当前位置:网站首页>[SCM]源码管理 - perforce 分支的锁定
[SCM]源码管理 - perforce 分支的锁定
2022-07-27 09:43:00 【51CTO】
perforce分支的锁定(Perforce branch locking)
通常地在某些milestone的build的时候或者某些branch的生命周期结束了,我们都需要锁定branch来禁止对branch的修改。
可以通过如下的两种方法来锁定perforce branch:
1)权限表(protection table)
通常地我们使用一个group来管理一个branch的权限。例如默认地如下:
write group envision * //dev/envision/esi/...
当 我们需要锁定branch //dev/envision/esi/... 时,可以在p4admin的GUI管理工具中修改protection table的权限行或在最后增加新的一行来lock branch,例如read group envision * //dev/envision/esi/...
也可以在脚本中使用p4 protect来修改权限表, 从而锁定或解锁某个branch。
2)triggers
也 可以使用一个trigger来达到锁定branch的目的。此trigger的执行过程为:当有changelist来的时候,检查所包含的文件是否属于 指定的branch,如果属于要锁定的branch则拒绝提交,从而达到lock branch的目的。所有的要lock的branches可以放到某个txt文件,然后trigger的脚本通过检查此txt来获得那些branches 要lock,当需要lock新的branch,只需要加到此txt中就可以了。
使用trigger方法的缺点的增加了所有的submit的时间。
完!
作者:iTech
微信公众号: cicdops
github: https://github.com/cicdops/cicdops
![[SCM]源码管理 - perforce 分支的锁定_管理工具](/img/c6/daead474a64a9a3c86dd140c097be0.jpg)
边栏推荐
- 会议OA项目之会议排座功能&&会议送审的实现
- Go Basics - arrays and slices
- 刷题《剑指Offer》day03
- 七月集训(第09天) —— 二分查找
- Annotation and reflection
- Lua function nested call
- System parameter constant table of system architecture:
- 面试京东 T5,被按在地上摩擦,鬼知道我经历了什么?
- What happens if the MySQL disk is full? I really met you!
- July training (day 09) - two point search
猜你喜欢
随机推荐
关于getter/setter方法问题
Nacos is used as a registration center
注解与反射
July training (day 09) - two point search
I haven't delivered books for a long time, and I feel uncomfortable all over
July training (day 12) - linked list
七月集训(第13天) —— 双向链表
swagger-editor
Lua函数嵌套调用
九种方式,教你读取 resources 目录下的文件路径
WordPress prohibits login or registration of plug-ins with a specified user name [v1.0]
七月集训(第04天) —— 贪心
July training (day 13) - two way linked list
曝光一位出身寒门的技术大佬
Understand chisel language. 26. Chisel advanced input signal processing (II) -- majority voter filtering, function abstraction and asynchronous reset
Explain knative cloud function framework in simple terms!
At the end of the year, I'll teach you how to get high performance!
Talk about 10 scenarios of index failure. It's too stupid
Go Basics - arrays and slices
July training (day 24) - segment tree









