在 Perforce 中,如何找到待处理更改列表中文件的本地路径?
给定 Perforce 更改列表编号,我想找到该待处理更改列表中所有文件的本地路径。
- p4描述变更列表 - 获取变更列表中文件的仓库路径(方法1)
- p4打开-c变更列表 - 获取变更列表中文件的仓库路径(方法 2)
- p4 have——获取之前提交的所有文件的仓库路径和本地路径
使用p4描述和p4 has的组合,我可以找到更改列表中先前已提交到 Perforce 的所有文件的本地路径(并打开以删除或编辑)。
但是为添加而打开的文件又如何呢? p4 has 不知道为 add 打开的文件的任何信息。
给定一个待处理的 Perforce 变更列表,我如何找到即将添加到 Perforce 的文件的本地路径?
Given a Perforce changelist number, I want to find the local path of all files in that pending changelist.
- p4 describe changelist -- gets me the depot path for files in the changelist (method 1)
- p4 opened -c changelist -- gets me the depot path for files in the changelist (method 2)
- p4 have -- gets me the depot path and local path for all files that have previously been submitted
Using a combination of p4 describe and p4 have, I can find the local paths for all files in the changelist that have previously been submitted to Perforce (and are opened for delete or edit).
But what about files that are opened for add? p4 have does not know anything about files that are opened for add.
Given a pending Perforce changelist, how do I find the local path for files that are about to be added to Perforce?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
要输出更改列表的所有待处理添加的本地路径,您可以使用:
这在没有 grep 的情况下执行相同的操作,但有点晦涩:
To output the local path of all pending adds of a changelist you can use:
This does the same without grep but is a bit more obscure:
您当然也可以使用
这将报告每个打开的文件的 depotFile 和 clientFile。
仅列出客户端文件:
将 //client/ 替换为客户端的根目录作为读者的练习。
You could of course also use
This will report both the depotFile and the clientFile for each opened file.
To list only client files:
Replacing //client/ with the client's root is left as an exercise for the reader.
待更改列表中所有文件的本地路径,无需任何外部或特定于平台的工具:
如果您想要为所有操作打开文件,请删除“-F action=add”。
Local path for all files in a pending changelist without any external or platform-specific tools:
Remove the '-F action=add' if you want to get files opened for all actions.
基于Peter G的回答,翻译成powershell 2.0:
Based on Peter G's answer, translated into powershell 2.0: