如何从特定的变更列表中获取分支的所有变更列表?

我喜欢使用Perforce Java API来创建自分支的特定变更列表以来的所有变更列表的列表。 在命令行中,您可以使用:p4更改-L BRANCHNAME @ CHANGELISTID,#head。 但现在我想使用API​​。

List fileSpecs = new ArrayList(); FilePath path = new FilePath(PathType.DEPOT, p4Branch + "/..."); FileSpec fileSpec = new FileSpec(path); fileSpec.setChangelistId(changelist.getId()); printFileSpec(fileSpec); fileSpecs.add(fileSpec); try { changelists = server.getChangelists(100, fileSpecs, null, null, false, true, false, true); if(changelists.isEmpty()) { System.out.println("Empty Changelists"); } else { System.out.println("Changelists has " + changelists.size() + " elements"); } } catch (Exception e) { e.printStackTrace(); } 

使用fileSpec.setChangelistId(changelist.getId()); 我只能设置它会在Changelist之前给我更改列表(这与命令类似:p4更改-L BRANCHNAME @ CHANGELISTID,这也是我的fileSpecs看起来的确切方式。

是否有可能在API中设置一些东西来实现这一目标? 或者我是否必须使用API​​的一些不同方法?

谢谢。

尝试以这种方式构建FileSpec:

 List fileSpecs = FileSpecBuilder.makeFileSpecList(p4Branch + "/...@" + changelist.getId() + ",#head");