[p4] automatically building in the latest changelist number for a build

Douglas Palmer dpalmer at accelrys.com
Wed Mar 23 17:52:28 PST 2005

perforce-user-bounces at perforce.com wrote on 03/23/2005 05:21:50 PM:

> 2. runs 'p4 changes -m 1 -s submitted //filespec/...'
> 3. parses the result and gets the last submitted change number
> 4. runs 'p4 sync -f //filespec/... at change'
> TIP: it's important for steps 2, 3, and 4 to occur in this order. It's 
> safer to find out what's the last submitted change number first and then 

> fetch *that* version, than to fetch the latest version and then find out 

> what was the last submitted change number. The later suffers from a race 

> condition.

If you prefer to fetch the files first, you can avoid the race condition 
by changing the command to 'p4 changes -m 1 -s submitted 

This way you will only see the latest change sync'd to your workspace, and 
you will not get a false report of some change that was submitted after 
your sync.

I still prefer Paul's way, however.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://maillist.perforce.com/pipermail/perforce-user/attachments/20050323/563ca4aa/attachment-0007.html>

More information about the perforce-user mailing list