好消息是 Perforce 的下一个版本 (2012.1) 有一个 status 命令,可以更轻松地发现所有差异。
从另一个角度来看,您是否需要将整个项目放在您的工作空间中?您能否缩小工作区视图以仅处理数据的子集?
If I understand your situation:
You work against a very large project.
You have a local snapshot of the data that is not entirely up to date.
You wish to only obtain the differences between your snapshot and the latest on the server.
The steps you should follow are:
Run p4 sync -k to make Perforce think you have the latest copy of all files.
Run p4 diff -se ... | p4 -x - sync -f to force-sync any out of date files
Run p4 diff -sd ... | p4 -x - sync -f to force-sync any missing files
At that point you may have local files that were deleted from the server. If you care about those, you can write a simple script that detects them and removes them from your file system.
The good news is that Perforce's next release (2012.1) has a status command that will pick up all differences more easily.
To approach this from another angle, do you need the entire project in your workspace? Could you narrow your workspace view to only work with a subset of the data?
发布评论
评论(2)
如果我了解您的情况:
您应该遵循的步骤是:
p4sync -k
让 Perforce 认为您拥有所有文件的最新副本。p4 diff -sd ... | p4 -x -sync -f 强制同步任何丢失的文件
此时,您可能有从服务器中删除的本地文件。如果您关心这些,您可以编写一个简单的脚本来检测它们并将它们从文件系统中删除。
好消息是 Perforce 的下一个版本 (2012.1) 有一个
status
命令,可以更轻松地发现所有差异。从另一个角度来看,您是否需要将整个项目放在您的工作空间中?您能否缩小工作区视图以仅处理数据的子集?
If I understand your situation:
The steps you should follow are:
p4 sync -k
to make Perforce think you have the latest copy of all files.p4 diff -se ... | p4 -x - sync -f
to force-sync any out of date filesp4 diff -sd ... | p4 -x - sync -f
to force-sync any missing filesAt that point you may have local files that were deleted from the server. If you care about those, you can write a simple script that detects them and removes them from your file system.
The good news is that Perforce's next release (2012.1) has a
status
command that will pick up all differences more easily.To approach this from another angle, do you need the entire project in your workspace? Could you narrow your workspace view to only work with a subset of the data?
这是一个经典的 Perforce 问题。
为了实现这一点,您需要将一些命令连接在一起。
p4 diff -sd //仓库/路径/... | p4 -x –sync -f
p4 diff -sd
命令将查找工作空间中不存在的所有文件。p4 -x –sync -f
将强制同步这些文件。正如 p4-randall 在他的 答案 中所说,您可能还想运行
p4 diff -se ... | p4 -x -sync -f
同步任何过期的文件。哈特哈,
This is a classic Perforce question.
To achieve this you will need pipe a few commands together.
p4 diff -sd //Depot/Path/... | p4 -x – sync -f
p4 diff -sd
command will find all the files that do not exist in the workspace.p4 -x – sync -f
will forcible sync these files.As p4-randall has in his answer, you may also want to run
p4 diff -se ... | p4 -x - sync -f
to sync any files that are out-of-date.HTH,