1

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.

Goyuix
  • 23,614
  • 14
  • 84
  • 128
Kannan Ekanath
  • 16,759
  • 22
  • 75
  • 101

1 Answers1

5

The directory name should be given as

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

Kannan Ekanath
  • 16,759
  • 22
  • 75
  • 101