p4 同步到备用位置

发布于 2024-12-14 21:18:57 字数 356 浏览 0 评论 0原文

我正在编写一个构建脚本,该脚本获取特定变更列表的所有源代码并构建它。我希望能够随时运行脚本,而不必搁置本地更改或将文件移动到临时位置。该脚本将由定义了自己的工作区的其他人使用。

我认为最简单的方法是从临时位置的 Perforce 获取所有源代码并从那里进行构建。不幸的是 p4sync 似乎不支持这一点,它只会将文件放入工作区指定的客户端视图中,这意味着它会在我将文件复制到临时位置之前覆盖本地更改。

有没有办法使用 p4 将文件从 Perforce 复制到任意位置?

I am writing a build script that gets all the source code for a particular changelist and builds it. I would like to be able to run the script at any time, without having to shelve local changes or move files to a temporary location. The script will be used by others who have their own workspaces defined.

I thought it would be easiest just to get all the source code from Perforce at a temporary location and build from there. Unfortunately p4 sync does not seem to support this, it will only put files into the client view as specified by the workspace, meaning it would overwrite local changes before I could copy the files to the temporary location.

Is there any way to use p4 to copy files from Perforce into an arbitrary location?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

久光 2024-12-21 21:18:58

您可以为构建脚本创建一个专用工作区,然后使用以下命令将构建脚本与其同步

p4 -c [workspace name] sync [depot path]

。这是连续构建系统通常会执行的操作。在这种情况下,请务必清空工作区规范的 Host: 部分,以便它可以在多个系统上使用。

另一种方法可能是使用带有 -o 选项的 p4 print 将文件转储到任意位置而不同步它们。

You could create a dedicated workspace for the build script and then have the build script sync to it by using

p4 -c [workspace name] sync [depot path]

This is what a continuous build system would typically do. Be sure to blank out the Host: section of the workspace spec in this case so that it can be used on multiple systems.

An alternative might be to use p4 print with the -o option to dump the files to an arbitrary location without syncing them.

〗斷ホ乔殘χμё〖 2024-12-21 21:18:58

P4 同步只能根据客户端规范进行。您可能需要创建另一个客户端规范并同步到该客户端规范。

P4 sync can be done only to a client spec. Possibly, you need to create another client spec and sync to that client spec.

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