1 message in com.perforce.perforce-userauto-integrate?
FromSent OnAttachments
Jeff...@uplanet.com24 Feb 1998 11:29 
Subject:auto-integrate?
From:Jeff...@uplanet.com (Jeff@uplanet.com)
Date:02/24/1998 11:29:52 AM
List:com.perforce.perforce-user

I've gotten a couple of queries on this, since I alluded to it in some e-mail to this list, so I'll answer the questions on a more widespread basis.

I have two major codelines here - "mainline" (whence the next major product line will be spawned) and "3.xmaint" (current development for 3.0 releases, eventually 3.1 releases). There is development happening in both lines - "3.xmaint" is assumed to be code/fixes that will eventually need to go into 'mainline' so that the changes will appear in future releases.

We've got a lazy integration scheme set up here, because developers don't seem to want to do integrations *at all*. (They delay and then it becomes a really ugly merge.)

So... 1. I run Bob Andrews' copy of "/etc/init.d/p4" (downloadable from perforce.com) and his backup scripts (ditto). 2. I've added a fragment of code to "/etc/init.d/p4" that looks runs this when "/etc/init.d/p4 promotechange" is run: PATH=/usr/local/bin:$PATH export PATH P4USER=$P4OWNER export P4USER USER=$P4OWNER export USER . /usr/local/bin/p4env.sh p4 review -t Promote | sed 's/Change \([0-9]*\) .*/\1/' > /tmp/bug.$$ while read bugnum do echo Processing $bugnum /home/build/bin/p4-utils/promoteup.pl -c $bugnum [ "$bugnum" -gt 0 ] && p4 review -t Promote -c $bugnum done < /tmp/bug.$$ rm /tmp/bug.$$ This is sufficient to cause "promoteup.pl" to be run on every newly submitted bug. 3. The script "promoteup.pl" evaluates the change ("p4 describe -s changenum") and if all the files modified are in the same branch ("codeline") it runs "p4 integrate/p4 resolve -as" to move those changes to parent/child branches. . There is a table in this perl script to say what branches to do this for, and which ones to avoid. (For example, 3.xmaint->mainline is done; mainline->3.xmaint is not.) . The original change description is included in the new integrate change description (as an 'aside'). Developers here begged for this. . The new integration is run as the original user who submitted the change. . "p4 resolve -as" is about as paranoid as it can be, and is the only 'safe' flag I'd be willing to use for autointegrations.

I'll be glad to share this code, which is written in perl to run on a Sun platform. Other Unix platforms should be easy; Win/NT should be a little, but not a lot, harder.

Comments (and improvements!) welcomed.

-Jeff Bowles