Additional triggers for push and fetch commands

The section Triggering on pushes and fetches describes the triggers that you can run during the various phases of the p4 push and p4 fetch commands. These are triggers that are run by the server initiating the push or the fetch. However, for every initiator, there is a responder:

  • For every push by server A to server B, there is a server B receiving the items pushed by A.
  • For every fetch by server A from server B, there is a sever B that is being fetched from.

This creates additional trigger opportunities for the server receiving the push and the server responding to the fetch request. You can use command type triggers to take advantage of these opportunities. Within this context:

  • pre-user and post-user actions refer to the server initiating the push or fetch
  • pre-rmt and post-rmt actions refer to the responding server.

The responding (or remote "-rmt-") server can use these triggers:

Trigger Run this trigger on the remote server

pre-rmt-Push

Before it receives pushed content

post-rmt-Push

After it receives pushed content.

Two special variables are available for use with post remote push triggers:

  • %%firstPushedChange%% specifies the first new changelist number
  • %%lastPushedChange%% specifies the last new changelist number

pre-rmt-Fetch

before it responds to a fetch request

post-rmt-Fetch

After it responds to a fetch request