#have doesn't capture CLs of deleted files in Perforce

孤街浪徒 提交于 2021-02-05 09:23:25

问题


We are using the following P4 command for snapshot versioning.

p4 changes -m1 /path/to/files/...#have

I noticed that the above command doesn't capture CLs of deleted files if the CL is the head CL.

So it ends up having two artifacts with the same version but different files.

I was wondering how we can cover this edge case?


回答1:


This is an artifact of the fact that deleted files aren't synced to the client and will therefore never be included in #have.

If possible, the best way to address this IMO is to capture the changelist at the time you sync to the head revision. Do:

p4 changes -m1 -ssubmitted /path/to/files/...

and then use that changelist to do:

p4 sync /path/to/files/...@CHANGE

Since submitted changelists are immutable (outside of edge cases like obliterate and +S files) you now have a guarantee that anyone else syncing to that same path@change will get the same set of revisions that's in your workspace.

Note that the p4 changes command will capture changelists with deleted revisions, even if those revisions are then skipped by the p4 sync!



来源:https://stackoverflow.com/questions/65209462/have-doesnt-capture-cls-of-deleted-files-in-perforce

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!