[p4] Can I inject something into a changelist?

Stephen Vance steve at vance.com
Fri Jul 20 07:19:29 PDT 2007


If the trigger tries to submit another file, you may run into a deadlock
condition. The submit process you're in holds database locks that would
be necessary for the submit you want to perform. As you note, there is
also the recursive trigger issue, so your trigger would have to be aware
that it needs to ignore changes to the particular file in question.

The daemon approach will work. Just be sure to process the changelists
one-by-one and to also ignore changes to the special file.

Another approach would be to implement a trigger that only allowed a
submission if the user made the appropriate change to the special file.
That would keep the special file in the changelist in which the add or
delete was applied.

Steve

Greg Leach wrote:
> Whenever a file is added or removed from a branch, I need to update a 
> list of files (single file edit) in another section of our server.  
> Since this update is directly tied to the check-in that the user just 
> made, it would be ideal if I could update the list in a change-submit or 
> change-content trigger and inject the edited file into the changelist 
> being submitted.
>
> Of course, it doesn't look like this is possible, so I'm wondering if 
> there's something nasty waiting for me if I have the change-commit 
> trigger submit another changelist with just the one file that we need 
> updated.  There isn't the danger of recursive triggers, since the 
> updated file is outside the path that will be firing the trigger, but is 
> there anything else bad?  Or can I actually inject the update into the 
> changelist?
>
> Our last idea was to use a daemon to just poll the server to see if 
> there have been any adds or deletes since the last time the list was 
> updated.  I'm open to better ideas.  :)
>
> Thanks,
> -Greg
>
>
>
> This message and its attachments may contain legally privileged or confidential information. This message is intended for the use of the individual or entity to which it is addressed. If you are not the addressee indicated in this message, or the employee or agent responsible for delivering the message to the intended recipient, you may not copy or deliver this message or its attachments to anyone. Rather, you should permanently delete this message and its attachments and kindly notify the sender by reply e-mail. Any content of this message and its attachments, which does not relate to the official business of the sending company must be taken not to have been sent or endorsed by the sending company or any of its related entities. No warranty is made that the e-mail or attachment(s) are free from computer virus or other defect.
> _______________________________________________
> perforce-user mailing list  -  perforce-user at perforce.com
> http://maillist.perforce.com/mailman/listinfo/perforce-user
>
>   

-- 
Stephen Vance
www.vance.com


More information about the perforce-user mailing list