perforce - perforce:有没有办法强制从所有站点恢复所有打开的文件?
问题描述
抱歉,我刚刚更新了我的问题。
实际上我正在使用 2 个站点。
我拥有 perforce 服务器的管理员权限。我们正在尝试设计一些可以强制集成到分支中的东西。所以我们想确保目标分支没有任何人、任何人、任何工作区、任何站点打开的文件。
有没有办法让我做到这一点?
像这样的东西?
p4 revert <some option> //depot/destination/branch/...
提前致谢。
解决方案
-C
作为管理员,可以使用标志从服务器端强制恢复文件(即让服务器将它们视为不再打开) (您可能还需要--remote
在 DVCS 配置中):
%p4 help revert
revert -- Discard changes from an opened file
...
The -C flag allows a user to specify the workspace that has the file
opened rather than defaulting to the current client workspace. When
this option is used, the '-k' flag is also enabled and the check for
matching user is disabled. The -C flag requires 'admin' access, which
is granted by 'p4 protect'.
The --remote flag is useful for DVCS configurations in which files
of type +l are in use. 'p4 revert --remote=origin filename' reverts
the named file in your DVCS server, and additionally, if the file is
of type +l, releases the global exclusive lock on the file in the
origin server.
这实际上并没有修改受影响工作区中的文件;因此,这些工作区将处于不一致的状态,并且如果用户不小心,可能会面临丢失更改的风险(即,他们正在进行的工作可能被同步操作覆盖和/或被提交遗漏)。
我建议仅在文件被锁定时才进行强制还原;打开但解锁的文件不会干扰集成,而恢复它们只会使这些用户在事后协调他们的工作区变得更加困难。
推荐阅读
- ffmpeg - FFMPEG - 从本地流中每隔 n 秒保存一次快照
- terraform - 无法显示 tf 状态
- python - Flask 中的多处理,具有永远运行的功能
- google-cloud-platform - 如何使用 Google Cloud Run 启用自动 Gzip 压缩?
- kubernetes-ingress - 使用 okd 集群的 MQTT 通信
- python - 为 GitLab 编写脚本以自动合并合并请求
- terraform - 通过传入变量创建动态 yaml 文件
- javascript - 查找特定日期的可用时间
- deployment - 如果 Django 部署超时,如何获取 AWS Elastic Beanstalk 日志以找出问题的原因?
- javascript - 发生错误时如何防止文件系统访问 API 保存文件?