p4 同步到备用位置 [英] p4 sync to an alternate location

查看:45
本文介绍了p4 同步到备用位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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.

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

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.

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

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

推荐答案

您可以为构建脚本创建一个专用的工作区,然后使用

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]

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

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.

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

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

这篇关于p4 同步到备用位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆