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.
The directory name should be given as
"//depot/se/mydir/..." and not "//depot/se/mydir"
精彩评论