perforcerevision

Perforce -- How to obtain a revision number of a file given a specific time period


I am interested to obtain the revision number of a file given a specific date or time period in Perforce.

If I use p4 files, I find that if there are no new submissions on that time period, the comment returned when the p4 command is executed is:

no revision(s) after that date

Full example as below:

% p4 files //depot/project/file_a.c@2018/03/06,@2018/03/07 
//depot/project/file_a.c@2018/03/06,@2018/03/07 - no revision(s) after that date

But the information I am looking for is the revision number of file_a.c between 2018/03/06 and 2018/03/07, regardless whether there are submission during that dates or otherwise. Something like this would be good:

//depot/project/file_a.c#31 - edit change 12345678

Am I using the right Perforce command? Thanks for the help.


Solution

  • It sounds like what you're really asking for is what the latest revision of the file was as of 2018/03/07:

    % p4 files //depot/project/file_a.c@2018/03/07