使用Perforce获取文件信息
有什么方法可以从 perforce 获取特定目录下文件的以下输出?我想要:文件名、用户名上次修改时间、用户名上次修改日期、用户名创建时间、创建日期。
到目前为止,我只能获取更改列表及其描述的列表,但是我无法将其通过管道传输到另一个 P4 命令中以对其执行任何其他操作。顺便说一句,我在 Windows 中。
Is there any way I can get the following output from perforce for files under a certain directory? I'd like: file name, last modified by username, last modified date, created by username, creation date.
So far I've only been able to get a list of changelists and their descriptions, but then I can't pipe that into another P4 command to do anything else with it. I'm in Windows by the way.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用
p4 fstat
和随后的p4描述
,也可以解析p4 filelog
的输出:user@client< /code> 将是用户名和客户端工作区的名称。修订 #1 显然是创建日期,列表顶部的修订(此处为 #9)是最后修改的。因此,基本上您必须解析以“...”开头的第一行以获取最后修改的内容,并解析以“...”开头的最后一行以获取创建信息。
You can either go with
p4 fstat
and a subsequentp4 describe
or you could parse the output ofp4 filelog
:user@client
will be the username and the name of the client workspace. Revision #1 is obviously the creation date, and the revision on top of the list (#9 here) is the last modified. So basically you have to parse the first line that begins with '...' for the last modified stuff and the last line that begins with '...' for the creation information.