Thomas Miller
Thomas Miller

Reputation: 13

Grabbing date from p4 changes command

I am trying to grab the date, CL and user of a list of changelists submitted within a given timeframe.

p4 changes -s submitted //depot/mainline/... @2020/03/09,@2020/03/14

will give me the changes with a date but too much other information. So you can use -F to strip out the information delivered.

p4 -F %change%-%user%-%date% changes -s submitted //depot/mainline/... @2020/03/09,@2020/03/14

But irritatingly -F %date% does not mean "what date was this submitted?" it means "what date is it today?" This is despite the information on the -e flag telling me that %date% is the submitted date.

So any ideas on how to get the submitted date from the -F flag?

Many thanks!

Upvotes: 1

Views: 365

Answers (1)

Samwise
Samwise

Reputation: 71517

I assume you're on Windows and %date% is getting expanded by the shell so that p4 never sees it:

C:\Perforce\test>echo %date%
Thu 03/19/2020

Escaping the % will prevent that and let p4 see the command you actually wanted to run. In the cmd shell you can escape % as ^%:

C:\Perforce\test>p4 -F ^%date^% changes -m1
2020/03/16

Upvotes: 2

Related Questions