accurev mktrig [ -p <depot-name> ] [ pre-create-trig | pre-keep-trig |
pre-promote-trig | server-post-promote-trig ] <program-or-script>The mktrig command creates a trigger within a particular depot. A trigger can “fire” before or after certain AccuRev transactions occur. The following triggers are defined on a per-depot basis, affecting operations only with that particular depot:fire on the client machine, before an add transactionfire on the client machine, before a keep transactionfire on the client machine, before a promote transactionfire on the server machine, after a promote transactionWhen a trigger fires, it executes the trigger program or trigger script that you specify in the mktrig command. The names of all elements involved in the transaction are passed to this program or script as part of a parameters file.mktrig does not make a copy of the trigger script. It simply records the location at where AccuRev will look for the script when the trigger fires.Note: The trigger script need not exist at the specified location when you issue the mktrig command. AccuRev doesn’t look for the script until the trigger fires.A trigger fires exactly once per transaction. If you do a keep operation on 10 elements and there is a pre-keep trigger set, the trigger script will execute once, with an argument list containing all 10 element names. It is the script’s responsibility to process its entire argument list.The trigger script must be installed in a place that is accessible to everyone that will be using a depot with the trigger enabled. Separate copies of the script can be placed on each client machine. A better procedure is to place all scripts in a central, network-wide location that all client machines can “see” (UNIX/Linux mount or Windows network share). If triggers will fire on both Windows and UNIX/Linux machines, be sure to read Notes on Triggers in Multiple-Platform Environments of the AccuRev Administrator’s Guide.When a trigger fires, AccuRev looks for a script at the location you specify in the mktrig command. A pre-transaction trigger fires on the client machine:
• AccuRev searches for the trigger script on the server machine, using the search path of the “server account”: the user account that runs the accurev_server process — typically, acserver (UNIX/Linux) or System (Windows).Note: AccuRev uses a search path to locate the trigger script if you specify a simple name or a relative pathname for the script in the mktrig command (this is our recommendation); if you specify an absolute pathname for the script, no search path is involved.The triggers described above operate on a per-depot basis. For example, a pre-create-trig trigger might be activated in depot gizmo, but not in depot whammo. Two additional triggers execute on the AccuRev server machine:
• The server_preop_trig script executes before the command is executed, and can cancel the command altogether. This is a per-depot trigger.
• The server_admin_trig script executes after the command is executed. This script cannot cancel execution of the command. This trigger applies to AccuRev commands irrespective of which depot, if any, is being addressed. Note that the server_admin_trig script applies to all depots.You enable these triggers not with the mktrig command, but by installing the trigger scripts at well-known locations. For details, see Server-Side Triggers of the AccuRev Administrator’s Guide.AccuRev’s issue management facility, AccuWork, also supports triggers. See server_dispatch_post of the AccuRev Administrator’s Guide.-p <depot-name>AccuRev Triggers of the AccuRev Administrator’s Guide.
Micro Focus |