[p4] Adding a Changelist # to C++ code...?

Troughton, Robert rtroughton at midway.com
Thu Feb 21 00:18:52 PST 2008


Does anyone know of a way to integrate the last synced version number
from Perforce into C++ code, such that it can be displayed on screen?

 

I suspect that this is impossible... but it's worth asking.

 

Basically, if I sync to changelist X and make some changes, I'd like our
app to display on screen that I'm running version X. I know that there's
a commandline "hack" to find out the changelist that I last sync'ed to
(it's a hack because it does a search across the depot so could,
potentially, report an identical but different changelist). However, is
there a good way to automagically put this changelist number into the
sourcecode?

 

Has anyone attempted anything similar to this...?

 

Robert




More information about the perforce-user mailing list