Perforce 2002.1 Command Reference | ||
<< Previous Chapter p4 sync |
Table of Contents Index Perforce on the Web |
Next Chapter >> p4 typemap |
Triggers are run in the order listed in the table; if one trigger script fails, subsequent trigger scripts are not run. Even when a trigger script succeeds, the submit may fail because of subsequent triggers, or for other reasons. Thus, pre-submit triggers should be used only for validation, and should not perform operations that are dependent on the successful completion of the submit. If this is necessary, create a daemon instead.
To use the same trigger script with multiple file patterns, list the same trigger multiple times in the trigger table. Exclusionary mappings can be provided to exclude files from activating the trigger script; in this case, the order of the trigger entries matters, just as it does when exclusionary mappings are used in views (see the Examples section, below).
If a particular trigger name is listed multiple times, only the script corresponding to the first use of the trigger name is activated.
-i |
Reads the trigger table from standard input without invoking the user's editor. |
-o |
Writes the trigger table to standard output without invoking the user's editor. |
See the Global Options section. |
Argument |
Description |
---|---|
%changelist% |
The number of the changelist being submitted. (The abbreviated form %change% is also acceptable) |
%client% |
Name of the client workspace that submitted the changelist |
%clienthost% |
Hostname of the client |
%clientip% |
The IP address of the client |
%serverhost% |
Hostname of the Perforce server |
%serverip% |
The IP address of the server |
%serverport% |
The IP address and port of the Perforce server, in the format ip_address:port |
%serverroot% |
The value of the server's P4ROOT; the top-level directory of the server's files and metadata |
%user% |
The Perforce username of the user who submitted the changelist |
trig1 //depot/bar/... "/usr/bin/s1.pl %changelist%" |
Both the first and fourth lines call the script /bin/s1.pl %changelist%, since the first occurrence of a particular trigger name determines which script is run when that trigger name is subsequently used.
No triggers are activated if the user submits file //depot/bar/zebra, since the third line excludes this file, but if //depot/bar/zed is submitted, the trig1 script /usr/bin/s1.pl %change% will be run, since the fourth line overrides the third, and because the first script listed with the name trig1 is used.
Perforce 2002.1 Command Reference | ||
<< Previous Chapter p4 sync |
Table of Contents Index Perforce on the Web |
Next Chapter >> p4 typemap |