0

I'm seeking assistance to determine max changeListId/revisionId of the my local Perforce view using the p4java API. I've tries using the com.perforce.p4java.client.Client to create a list of FileSpec, but changeListId is not set on any of the files when querying the Client - Server is OK.

I am seeking the client's current revision number to help me determine if it is in synch with the server or not. Details such as this sample from 'p4 cstat' would be perfect:

p4 cstat
... change 1
... status have

...... 

... change 17
... status partial

... change 18
... status need

p4java p4java version 2012.3

Thanks in advance!

gbo
  • 3
  • 3
  • Perhaps you are going about things the hard way. If you described what underlying problem you are trying to solve, people might be able to give you better advice. As it is, you haven't given much context. – Bryan Pendleton May 25 '13 at 00:55
  • The answer to http://stackoverflow.com/questions/9731415/get-the-changelist-number-of-current-workspace-directory might point you in the right direction. Figure out how to translate that command into the P4Java API, and you should be set. – Mike O'Connor May 25 '13 at 06:35
  • Thanks for your reply! Added some more details. – gbo May 28 '13 at 13:44

1 Answers1

1

A common way to do this is to use "p4 changes -m q ///...#have". With P4Java you would use the GetChangelists() method on IOptionsServer with the appropriate filespec and version specifier.

Matt
  • 4,860
  • 1
  • 17
  • 15