1 Apr 2006 07:18
Re: [p4] Using a changelist id as a build number?
Jeff A. Bowles <jab <at> pobox.com>
2006-04-01 05:18:11 GMT
2006-04-01 05:18:11 GMT
On Mar 31, 2006, at 11:20 AM, <Ken.Williams <at> thomson.com> wrote: > I think the easiest way to avoid a race condition is to first ask 'p4 > counter change' what the current changelist number is, then sync to > that > number and build. If someone submits more changes while you're doing > that, you never need to care, you won't see those changes. > > If you want to get fancier, you can sync to that change number then > ask > 'p4 changes -m1 ...' what changelist is actually present in your build > directory (presumably you don't care about changes outside that > space). > If it's the same as last time you built (which you could keep track of > with a p4 counter or elsewhere) then you can skip the build. You might just do a "p4 changes -m1 //depot/pathname/..." (I'd add "-s submitted" as an option, also) at the beginning of the script. It'll give you a change number back. Sync to that change number. Put that change number in your version.h that you generate. Put it in your build reports as "build path: //depot/pathname/... <at> xxxx" where 'xxxx' is the change number. No muss, no fuss. And no race.(Continue reading)
RSS Feed