Perforce P4J 获取目录的更改列表

发布于 2024-08-07 22:09:50 字数 635 浏览 5 评论 0原文

我正在尝试使用 P4J 获取目录上的更改列表。这是我使用的代码片段,

P4JServer server = //get a valid server using username/pwd
List<P4JFileSpec> fileSpec = P4JFileSpecBuilder.makeFileSpecList(new String[]{"//depot/se/mydir"}); //a valid directory
if(P4JFileSpecBuilder.getValidFileSpecs(fileSpec).isEmpty()) {
    throw new RuntimeException("File spec invalid for [" + depotPath + "]"); 
}
List<P4JChangeList> changes = server.getChangeLists(10, fileSpec, null, null, true, true, false, true);
System.out.println(changes.size()); //prints 0 here   

但是如果我使用“//depot/se/myfile”,这是一个有效的文件,则会打印更改列表。我做错了什么吗?我需要目录上的更改列表。

I am trying to get the changelists on a directory using P4J. Here is the snippet I used,

P4JServer server = //get a valid server using username/pwd
List<P4JFileSpec> fileSpec = P4JFileSpecBuilder.makeFileSpecList(new String[]{"//depot/se/mydir"}); //a valid directory
if(P4JFileSpecBuilder.getValidFileSpecs(fileSpec).isEmpty()) {
    throw new RuntimeException("File spec invalid for [" + depotPath + "]"); 
}
List<P4JChangeList> changes = server.getChangeLists(10, fileSpec, null, null, true, true, false, true);
System.out.println(changes.size()); //prints 0 here   

However if I used "//depot/se/myfile" which is a valid file this prints changelists. Am I doing something wrong? I need changelists on a directory.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

ゞ花落谁相伴 2024-08-14 22:09:50

目录名称应为

“//depot/se/mydir/...”而不是“//depot/se/mydir”

The directory name should be given as

"//depot/se/mydir/..." and not "//depot/se/mydir"

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