您要基于脚本的命令是p4 filelog
. filelog
在特定修订版上运行会告诉您它是从哪些修订版集成到哪些修订版中的:
C:\Perforce\test>p4 filelog @=117
//stream/main/mob/nextproject/custom/configuration
... #2 change 117 integrate on 2019/02/22 by Samwise@Samwise-dvcs-1509687817 (text) 'tada'
... ... merge from //stream/main/mob/project/configuration#2
您可以递归地执行此操作:
C:\Perforce\test>p4 filelog //stream/main/mob/project/configuration#=2
//stream/main/mob/project/configuration
... #2 change 116 edit on 2019/02/22 by Samwise@Samwise-dvcs-1509687817 (text) 'foo'
... ... merge into //stream/main/mob/nextproject/custom/configuration#2
Revision Graph 在单个文件上执行此操作,这非常简单。除非您做出一些简化的假设,否则在变更列表的基础上执行此操作有点棘手——变更列表可能会被部分集成(即,并非所有修订都被集成),但如果您只是假设这永远不会发生,然后您可以构建一堆修订图并通过通用更改列表将它们合并在一起。