[p4] running a special trigger on one directory

Jeff Grills jgrills at junctionpoint.com
Fri May 19 09:28:27 PDT 2006


That's not supported that I know of, but there are some other options.
Commit triggers run on changelists, so first you have an issue if you allow
someone to submit to both directories in a single changelist; with the
exclusionary syntax you mention below, what triggers would you expect to run
in this case?  Both?  Neither?  I'm not sure there is a good answer.
Anyway, you can prohibit submits to both locations with another trigger that
runs first if you so desire (which seems useful in this case).

Now that you have your submit restricted to one directory or the other, you
could have your "mytrigger" check the files submitted and if it sees
something in //depot/testing/..., then it just returns success and doesn't
do any of its other processing.  Then the "debugtrigger" will get its chance
to do whatever it needs to do.

I've found that over time, I've started to combine multiple logical triggers
into one physical trigger and run less processes on the submit.  Many of my
logical triggers would want to parse the changelist comments, and by
combining them into a single physical trigger, I can make the call to p4
just once to obtain the changelist description and then process that in
several different ways.  This might make sense for you as well.  Limiting
"trips to the well" is often one of the first things that needs to be done
to improve server performance if that becomes an issue anyway.

j

-----Original Message-----
From: perforce-user-bounces at perforce.com
[mailto:perforce-user-bounces at perforce.com] On Behalf Of Mark Harrison
Sent: Friday, May 19, 2006 10:59 AM
To: perforce-user at perforce.com
Subject: [p4] running a special trigger on one directory

I have a trigger I run on the entire depot:


Triggers:
       mytrigger commit //depot/...   "mytrigger %changelist%"


Now I want to have a special debugging version that will
only run for files submitted in a test directory, something
like this:

Triggers:
       mytrigger  commit //depot/...         "mytrigger %changelist%"
       mytrigger2 commit //depot/testing/... "debugtrigger %changelist%"

But the triggers are executed in order...

Can I use the exclusion syntax to get this result, something
like this?


trig1 commit //depot/...          "mytrigger..."
trig1 commit -//depot/testing/... "mytrigger..."
trig2 commit -//depot/...         "dbgtrigger..."
trig2 commit //depot/testing/...  "dbgtrigger..."

Many TIA!
Mark


More information about the perforce-user mailing list