[p4] Coordinating Branches
David Weintraub
qazwart at gmail.com
Fri Apr 6 08:30:32 PDT 2007
I have a few problems with using a trigger...
* Triggers first of all run on the server and not the client's
machine. Therefore, they have no access to the client's workspace, or
really to any workspace (unless you specifically create a workspace on
the server just to handle this issue).
* Even if you do get the trigger to work, you'll be slowing down the
server as the server does its checkouts, changes, and submissions.
* The trigger would modify the client's workspace behind their back
which means as soon as the client submits something, their workspace
is out of date. Not a very good thing to do.
* In order for this to work, the trigger would be fired on Submit.
Let's say you have this trigger update a workspace on the server's
system (since the trigger has no access to the client's system). The
trigger would have to copy the file, then do another submit which
would fire another trigger. If you are not careful, you could end up
with an infinite cascades of triggers firing triggers.
* Your changelists would be out of whack because every submit you do
causes an automatic submit by the trigger. Tracing your history may be
confusing.
* What if the trigger on the server fails? A failed submit causes
files in the changelist to be exclusively locked to prevent other
users from editing them until the changelist is successfully
resubmitted. You may find yourself having to go in and fix issues
caused by the trigger.
I guess the real question is why do you want changes in one file on
one branch to automatically sync to the same file on another branch?
The purpose of branching is to cause two separate development paths.
Forcing the sync between the two files might cause major problems on
the other branch. Just because your product built on B1 doesn't mean
those changes will automatically build on B2. Perforce makes
integrating changes between branches much easier, but there is still a
need for a developer to manually go through and make sure that these
changes do work.
Integrations from branch B1 to branch B2 should only be done when the
developers working on B2 are ready to incorporate the needed changes.
This is one of those careful balancing acts. Merge too often, and the
development environment on B2 becomes unstable. Developers spend more
time fixing integration issues than doing their development. Merge too
little, and the developers have a nice stable environment, but merging
becomes an arduous task.
What we as CMs have to remember is that development is more than just
automating a bunch of tools, it is about getting developers to
implement good development procedures and to guide those developers
into following these procedures.
You would be much better off running a cronjob with the "p4
interchanges" command to see what integrations are needed, and to use
this to help remind developers to do their integrations. Information
on the "p4 interchanges" command can be found via "p4 help undoc".
On 4/6/07, Eramo, Mark <meramo at 170systems.com> wrote:
> You should probably be able to do this with a trigger.
>
> For example, Say the source files your interested in is the exact same
> in b1 and b2. If that's the case then you have to files that are the
> same in b1 and b2, read only in b2. This way, users cannot update those.
>
> The files in b1 are read/write.
>
> You setup a trigger on the files in b1 so that when one is updated that
> change is propagated to the same file in b2.
>
> Now there might be some files in b2 that do not exist in b1. Those can
> be read/write in b2.
>
> There is documentation on the Perforce website on triggers:
>
> http://www.perforce.com/perforce/technotes/note028.html
>
>
> Also, I think you will find information in the Perforce System
> Administration guide and the "Practical Perforce" book that is available
> from various online retailers.
>
> Regards,
>
> Mark
>
>
>
> -----Original Message-----
> From: perforce-user-bounces at perforce.com
> [mailto:perforce-user-bounces at perforce.com] On Behalf Of R K
> Sent: Thursday, April 05, 2007 11:52 PM
> To: perforce-user at perforce.com
> Subject: [p4] Coordinating Branches
>
> All,
> Suppose there are 2 branches say B1 and B2 . If I make changes to a file
> and
> submit , is there a way in perforce to submit it in B2 also ( B1 is a
> subset of B2) . If there is a way how can it be done ?
>
>
> Regards
> Ram
> _______________________________________________
> perforce-user mailing list - perforce-user at perforce.com
> http://maillist.perforce.com/mailman/listinfo/perforce-user
>
> _______________________________________________
> perforce-user mailing list - perforce-user at perforce.com
> http://maillist.perforce.com/mailman/listinfo/perforce-user
>
--
--
David Weintraub
qazwart at gmail.com
More information about the perforce-user
mailing list