在发布前几天锁定 SubVersion 分支
在发布之前的几天,我们希望能够阻止开发人员将文件提交到 SubVersion 分支,除非团队负责人已经审查并批准了更改(在这种情况下,他们将进行临时更改以允许这样做)。
之前我们使用ClearCase,这相对容易做到。
由于 svn:lock 命令仅适用于每个文件,因此我们不确定是否可以在 SubVersion 中模拟此行为。
你做什么工作?
In the days before a release we'd like to be able to prevent developers from committing files to the SubVersion branch, unless a team leader has reviewed and approved the changes (in which case they would make a temporary change to allow this).
Previously we used ClearCase, in which this was relatively easy to do.
Since the svn:lock command only works on a per-file basis, we are uncertain if we can emulate this behaviour in SubVersion.
What do you do?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
横向思考 - 为什么不在您想要“锁定”它的点创建一个分支,并仅在构建/发布过程中检查该修订号。
然后,开发人员仍然可以签入主干(或他们正在处理的任何其他分支),如果团队领导批准了版本的更改,那么它们可以合并到分支中。
当然,这实际上并没有“锁定”发布分支,但至少您可以在必要时轻松跟踪/撤消更改,并且不会阻止人们工作。开发人员来源仍将指向他们正在处理的分支/主干,而不是新的发布分支。
在 SVN 中创建分支非常便宜且容易(我相信)。
Laterally thinking - why not just create a branch at the point at which you want to 'lock' it and only check out that revision number in your build/release process.
Then developers can still check-in to the trunk (or whatever other branch they're working on) and if a team leader approves changes for the release then they can be merged into the branch.
Granted this doesn't actually 'lock' the release branch but at least you can easily track/undo changes if necessary and it doesn't prevent people working. The developers source will still be pointing to the branch/trunk they were working on rather than the new release branch.
Creating branches is very cheap and easy in SVN (I believe).
您可以查看 GUI svn 客户端,它们通常比命令行客户端具有更丰富的界面/功能集。例如,我使用 TortoiseSVN ,它具有适用于递归锁定所选文件夹中的所有文件的选项获取锁定/释放锁定。
顺便说一句,它还可以方便地选择创建标签/分支并作为一个操作切换到它。
You can have a look at GUI svn clients which usually have richer interface/functionality set than a command line one. For example, I'm using TortoiseSVN which has options Get Lock/Release Lock applicable for locking all files in the selected folder recursively.
BTW, it also has convenient option of making tag/branch and switching to it as one action.
您可以在服务器上添加一个预提交挂钩,该挂钩检查提交目标是否包含关闭的分支,并且可能在日志消息中添加一个关键字来绕过此检查。
You can add a pre-commit hook on the server, which checks if the commit target contains closed branches, and maybe a keyword in the log message to bypass this check.
我们所做的是将分支移至标签,并且仅对该标签具有只读访问权限。
What we do is to move the branch over to a tag and only have readonly access to the tag.