简体   繁体   English

自特定的更改列表以来,如何获取分支的所有更改列表?

[英]How can i get all Changelists of a branch since a specific Changelist?

I like to use the Perforce Java API to make a list of all changelists since a specific Changelist of a Branch. 我喜欢使用Perforce Java API列出自分支的特定变更列表以来的所有变更列表。 On the command line you can get it with: p4 changes -L BRANCHNAME@CHANGELISTID,#head. 在命令行上,您可以使用以下命令获取它:p4更改-L BRANCHNAME @ CHANGELISTID,#head。 But now i like to use the API. 但是现在我喜欢使用API​​。

 List<IFileSpec> 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();
    }

With fileSpec.setChangelistId(changelist.getId()); 使用fileSpec.setChangelistId(changelist.getId()); I only can set that it will give me the Changelists before the Changelist (Which is similar to the command: p4 changes -L BRANCHNAME@CHANGELISTID that's also exact how my fileSpecs looks. 我只能设置为它将在变更列表之前给我变更列表(这与命令类似:p4更改-L BRANCHNAME @ CHANGELISTID,这也与我的fileSpecs外观完全一样。

Is there a possibility to set something in the API to achieve this? 是否可以在API中进行设置以实现这一目标? Or do i have to use some different Methods of the API? 还是我必须使用一些不同的API方法?

Thanks. 谢谢。

尝试通过以下方式构建FileSpecs:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 自百里香以来,我如何获得元组值(querydsl)? - How i can get tuple value (querydsl) since thymeleaf? 如何获得当前自午夜以来的毫秒数? - How can I get the count of milliseconds since midnight for the current? 如何在Java的特定程序包中获取所有Class文件? - How can I get all Class files in a specific package in Java? restfb获取自特定日期以来所有帖子的所有评论 - restfb get all comments on all post since specific date 如何使用perforce java api将变更列表合并到另一个分支 - how to merge changelist into another branch using perforce java api 如何获得名称而不是值的TreeView分支? - How can I get a TreeView branch by name rather than value? 由于没有更多的 JRE 11 可供下载,如何让 Java 11 运行时环境正常工作? - How can I get Java 11 run-time environment working since there is no more JRE 11 for download? 如何使用特定的Annotation获取所有方法的javadoc,方法名称和包/类名? - How can I get the javadoc of all methods with a specific Annotation, with the method name and package/class name? 如何获取 HashMap 中包含的所有键的特定属性值? - How can I get a specific attribute value for all the keys contained in a HashMap? 如何从数据库到另一布局获取特定行的所有列? - How can I get all columns for a specific row from the database to another layout?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM