使用Perforce获取文件信息

发布于 2025-01-04 13:26:22 字数 168 浏览 0 评论 0原文

有什么方法可以从 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

谁的年少不轻狂 2025-01-11 13:26:22

您可以使用p4 fstat和随后的p4描述,也可以解析p4 filelog的输出:

$ p4 filelog Rakefile
//depot/path/to/Rakefile
... #9 change 421932 edit on 2011/10/27 by user@client (text) '....'
... #8 change 421210 edit on 2011/10/24 by user@client (text) '....'
... #7 change 419771 edit on 2011/10/17 by user@client (text) '....'
... #6 change 393076 edit on 2011/05/26 by user@client (text) '....'
... #5 change 374172 edit on 2011/02/11 by user@client (text) '....'
... #4 change 374083 edit on 2011/02/11 by user@client (text) '....'
... #3 change 374042 edit on 2011/02/11 by user@client (text) '....'
... #2 change 373901 edit on 2011/02/10 by user@client (text) 'need ci/reporter rake-task'
... #1 change 359972 add on 2010/11/23 by user@client (text) 'added first version'

user@client< /code> 将是用户名和客户端工作区的名称。修订 #1 显然是创建日期,列表顶部的修订(此处为 #9)是最后修改的。因此,基本上您必须解析以“...”开头的第一行以获取最后修改的内容,并解析以“...”开头的最后一行以获取创建信息。

You can either go with p4 fstat and a subsequent p4 describe or you could parse the output of p4 filelog:

$ p4 filelog Rakefile
//depot/path/to/Rakefile
... #9 change 421932 edit on 2011/10/27 by user@client (text) '....'
... #8 change 421210 edit on 2011/10/24 by user@client (text) '....'
... #7 change 419771 edit on 2011/10/17 by user@client (text) '....'
... #6 change 393076 edit on 2011/05/26 by user@client (text) '....'
... #5 change 374172 edit on 2011/02/11 by user@client (text) '....'
... #4 change 374083 edit on 2011/02/11 by user@client (text) '....'
... #3 change 374042 edit on 2011/02/11 by user@client (text) '....'
... #2 change 373901 edit on 2011/02/10 by user@client (text) 'need ci/reporter rake-task'
... #1 change 359972 add on 2010/11/23 by user@client (text) 'added first version'

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文