James Ives
James Ives

Reputation: 3365

Watch for Submissions and Changes in P4

Is there a way to 'watch' for submissions to all, or a specific depot, in Perforce? I was looking at p4 reviews but I'm not sure if it's what I need.

I want to make a piece of middleware that will send a payload to an internal service whenever someone makes a submission but I need some sort of way to watch for those changes. Something like p4 changes but in real-time so a new line is printed to the terminal whenever a change is made.

What am I best off using for this?

Upvotes: 0

Views: 302

Answers (1)

Gabe Weiss
Gabe Weiss

Reputation: 3342

So, the review daemon (and by extension reviews on your user) is the recommended way to watch for changes, BUT, it sounds like you want more customization here...

So, if you go down a rabbit hole too far and decide you just want basic reviews, this article: http://answers.perforce.com/articles/KB/2920 details what needs to be setup.

Having said that, a way to do this would be triggers on the server. Check out p4 triggers. You can catch a submit in several places. Before it's properly committed to the server, after it's officially committed, etc.

What you can do is setup a trigger that runs a script and either checks in a file to another part of the depot with processed payload from the changelist, or email a set of folks, whatever you want. Triggers can run arbitrary scripts (with all the security issues that can bring of course).

Upvotes: 3

Related Questions