在发布前几天锁定 SubVersion 分支

发布于 2024-09-12 04:50:04 字数 203 浏览 12 评论 0原文

在发布之前的几天,我们希望能够阻止开发人员将文件提交到 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

橙幽之幻 2024-09-19 04:50:04

横向思考 - 为什么不在您想要“锁定”它的点创建一个分支,并仅在构建/发布过程中检查该修订号。

然后,开发人员仍然可以签入主干(或他们正在处理的任何其他分支),如果团队领导批准了版本的更改,那么它们可以合并到分支中。
当然,这实际上并没有“锁定”发布分支,但至少您可以在必要时轻松跟踪/撤消更改,并且不会阻止人们工作。开发人员来源仍将指向他们正在处理的分支/主干,而不是新的发布分支。

在 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).

满身野味 2024-09-19 04:50:04

您可以查看 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.

深白境迁sunset 2024-09-19 04:50:04

您可以在服务器上添加一个预提交挂钩,该挂钩检查提交目标是否包含关闭的分支,并且可能在日志消息中添加一个关键字来绕过此检查。

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.

溺深海 2024-09-19 04:50:04

我们所做的是将分支移至标签,并且仅对该标签具有只读访问权限。

What we do is to move the branch over to a tag and only have readonly access to the tag.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文