I'm trying to clone the P4 repository in a Java program, using P4java for the same.
How can I clone entire P4 repository at once?, Instead of reading one file at a time (as shown below) ?
fileList = server.getDepotFiles(FileSpecBuilder.makeFileSpecList(new String[] {"//depot/dir/apps/..."}), false);
for (IFileSpec fileSpec : fileList){
if (fileSpec != null){
BufferedReader br = new BufferedReader(new InputStreamReader(fileSpec.getContents(true)));
// create new file locally and write content
}
}
Any help is appreciated.
I found this solution, working fine. (Thanks to the blog). Basically, it creates a new temporary client and clones the repo using filespec list(depot file names) and p4 sync command. Edited code here :
Thanks @Sam Stafford for giving me right direction.