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

Steve M. Robbins steve at sumost.ca
Fri Feb 22 07:48:42 PST 2008

On Thu, Feb 21, 2008 at 10:55:32AM -0600, Steve M. Robbins wrote:
> On Thu, Feb 21, 2008 at 11:12:46AM -0000, Robert Cowham wrote:
> > One way is to do this as part of your build process:
> > 
> > A belt and braces way, assuming you are in root of workspace:
> > 
> > Get the output of "p4 changes -m 1 -s submitted ...#have" - this gives you
> > changelist in your workspace rather than whole repository (say 1234)
> > 
> > Ensure that the output of "p4 sync -n ... at 1234" is empty meaning you are
> > cleanly synced to that changelist.
> Nice.  However, doesn't this also assume that you have somehow
> communicated the client name to p4?  Either you have to have it set in
> the environment (but then who uses just one client?) or you have to
> have a p4config file properly set up.

I am still struggling with how to do this client-side without
having p4config files all over the place; c.f. my post about
p4config being mandatory.

So then I started to wonder whether it could be done server-side,
e.g. with a submit trigger.  At submit time, you know (1) the
changelist number, and (2) that you are "cleanly synced".  I have a
feeling, though, that it's not possible to edit a file in a trigger
and "p4 submit" it.  Or is it?  

Is there a server side solution to this?


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://maillist.perforce.com/pipermail/perforce-user/attachments/20080222/e1adcf29/attachment.sig>

More information about the perforce-user mailing list