Jump to content

P4JAVA : How can I implement "p4 files -e -m 100 //DEPOT/...SOMEFILE*"

P4JAVA files command file search find file

  • Please log in to reply
1 reply to this topic

#1 unsung yi

unsung yi


  • Members
  • Pip
  • 1 posts

Posted 28 July 2015 - 08:03 AM


I would like to find class for implementing follow command

"p4 files -e -m 100 //DEPOT/...readme.txt*"

looks FileSpecBuilder doesn't support "find" action for specific filename on specific branch.

Anybody knows it ?

#2 P4Jen


    Advanced Member

  • Staff Moderators
  • 155 posts

Posted 21 August 2015 - 10:49 AM


You can achieve what you want, by adding the '-e' flag as an argument, to the 'GetDepotFilesOptions' object:

List<IFileSpec> fileList = server.getDepotFiles(
//Add the '-e' option.
FileSpecBuilder.makeFileSpecList("//depot/..."), new GetDepotFilesOptions("-e"));

On my test server, the file 'cat.txt' had been deleted. The following output shows it was not displayed, when the above was run:

  ListFilesDemo.main({ })
  Depot files on Perforce server at URI 'p4java://localhost:1666':
  Starting command 2
  2 - //depot/fortest/javatest.txt#2 - edit change 16 (xtext)
  2 - //depot/test.txt#2 - integrate change 17 (xtext)
  Stopping command 2


Also tagged with one or more of these keywords: P4JAVA, files, command, file search, find file

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users