Detailed trigger reference
Detailed reference for triggers in Unity Version Control.
読み終わるまでの所要時間 27 分最終更新 9ヶ月前
The following section provides a detailed reference of all the triggers as well as input and output parameters. Samples are provided for the most common actions.
Add
Heading | Value |
|---|---|
| Trigger names |
|
| Description | It executes user scripts when items are added to the source control. |
| Runs on | Server |
Filters
You can use the following filters:
- Repository name
- Standard input
For example, if , then the trigger executes only for repository
and if at least one of the lines in the standard input is about adding a C# file.
--filter="rep:test,*.cs"testStandard input
A list of files to be added.
Output result
Result code from the trigger script or executable determines the success or failure of the operation:
Output result | Description |
|---|---|
| The trigger was completed successfully. The items will be added. |
| Non zero | Failure. |
Environment variables
In addition to the variables defined in sections Common environment variables and server.conf variables, these are also available:
Environment variable | Description |
|---|---|
| The comment given by the user on the add operation. |
Checkin
Heading | Value |
|---|---|
| Trigger names |
|
| Description | It executes user scripts when a checkin operation is performed on any client. |
| Runs on | Server |
Filters
You can use the following filters:
- Repository name
- Standard input
For example, if , then the trigger executes only for repository
and if at least one of the lines in the standard input is about a change ()
in a file.
--filter="rep:code,CH *search.c*"codeCH*search.c*Standard input
The standard input receives revision identifiers for all the items involved in the checkin operation, one per line. Each of them is a specially formatted string containing the server's path of the item (independent of any workspace) and the revision specification, so its contents are easily retrieved using the command.
cm catThis is the format of the revision specifications, one per line:
status item_path item_type#br:branch;changeset:cset_id@@rep:rep_name@@repserver:server
The meaning of the members in italic is detailed in the following table:
Member | Description |
|---|---|
| The status of the item to be checked in: added (AD), changed (CH), moved (MV), deleted (DE)... |
| The revision's path in server format, which is independent of the client workspace and operating system. |
| The type of the item: DIR or FILE. |
| The branch of the revision. |
| Only available in the |
| The repository name where the revision belongs. |
| The repository server and port where the repository belongs. |
This example shows standard input supplied to a checkin trigger when making a checkin to the changed file:
search.hCH "/" DIR#br:/main/scm001;changeset:61@@rep:doom3src@@repserver:HERMES:8087CH "/search" DIR#br:/main/scm001;changeset:61@@rep:doom3src@@repserver:HERMES:8087CH "/search/search.h" FILE#br:/main/scm001;changeset:61@@rep:doom3src@@repserver:HERMES:8087
Output result
Result code from the trigger script or executable determines the success or failure of the operation:
Output result | Description |
|---|---|
| The trigger completed successfully. Items will be checkedin the repository. |
| Non zero | The trigger reports failure. If the trigger is |
Environment variables
In addition to the variables defined in sections Common environment variables and server.conf variables, these are also available:
Environment variable | Description |
|---|---|
| The comment given at checkin time by the user. |
| This variable indicates whether the checkin is a shelve operation or not. |
| Only available in the |
| Only available in the Each The variables are:
|
| Same as PLASTIC_PENDING_MERGE_LINKS environment variable but only available in the |
Comments
The and triggers are invoked only once for all the items involved in the checkin operation. The standard input of the trigger will receive a list of the items involved.
before-checkinafter-checkinThis is one of the most complex and useful triggers. Some examples of usages: Checking code before it is checked in on the repository against some validation/formatting tool or sending emails/updating rss feeds when new code is in the repository.
Revision contents can be accessed through the command, specifying the revision specification supplied in the standard input. They can be validated, modified, and then stored back into the server with the command. In case a command updates the contents of a revision in the repository, the client performing the checkin operation will automatically update those items, so the contents of the workspace are always correct.
cm catcm shelvesetshelvesetSample command line creation
cm trigger create checkin-before "checkstyle" "c:\tmp\triggers\checkin-checkstyle.bat"Trigger created on position 1.
Sample trigger script
The following script reads all the standard input and redirects it to the file. The trick here is the use of the command to read the standard input in Windows command line :
c:\tmp\triggers\checkinout.txtfind.execmd.exe@@echo offfor /f "tokens=*" %%g in ('find /V ""') do (echo %%g >> c:\tmp\triggers\checkinout.txt)exit 0
Merge
Heading | Value |
|---|---|
| Trigger names |
|
| Description | This trigger can be used to deny the merge of some branches if certain conditions are not met. |
| Runs on | Server |
Filters
You can use the following filters:
- Repository name
- Standard input
For example, if , then the trigger executes only for repositories whose
name starts with and if at least one line in the standard input is an merge
conflict.
--filter="rep:dev*,*EVIL*"devevilStandard input
The standard input for the and the actions is one of the following:
mergemergeToIf the merge operation can't be performed, then the standard input is the reason why:
Code | Description |
|---|---|
| Source and destination are not connected. Returned by the subtractive merge. |
| The selected changesets interval |
| No ancestor found between source and destination. |
| Source is already included on destination. Merge not needed. |
| The source is already subtracted from the destination. Subtractive merge not needed. |
| There are no changes between source and destination. |
If the merge operation is performed, the standard input is a list of conflicts in the following order:
- Directory conflicts
- File conflicts
- Writable xlinks conflicts
Then add the operations to apply (source changed, deleted, added, and so on). Each conflict and operation must be one per line. Refer to the following examples for each type:
Conflicts
ADD_MOVE [SRC] A "/foo.c" cs:10 - [DST] M "/bar.c" -> "/foo.c" cs:5CHANGE_DELETE [SRC] C "/foo.c" cs:12 (base cs:7) - [DST] D "/foo.c" cs:7CYCLE [SRC] M "/server" -> "/bin/server" cs:5 - [DST] M "/bin" -> "/server/bin" cs:5DELETE_CHANGE [SRC] D "/foo.c" cs:7 - [DST] C "/foo.c" cs:12 (base cs:7)DELETE_MOVE [SRC] D "/foo.c" cs:10 - [DST] M "/foo.c" -> "/bar.c" cs:10DELETE_MOVE [SRC] D "/foo.c" cs:10 - [DST] M "/foo.c" -> "/bar.c" cs:10DIVERGENT_MOVE [SRC] M "/foo.c" -> "/bar.c" cs:5 - [DST] M "/foo.c" -> "/qux.c" cs:5EVIL_TWIN [SRC] A "/foo.c" cs:10 - [DST] A "/foo.c" cs:5LOADED_TWICE [SRC] A "/bar.c" cs:10 - [DST] A "/foo.c" cs:5MOVE_ADD [SRC] M "/bar.c" -> "/foo.c" cs:10 - [DST] A "/foo.c" cs:5MOVE_DELETE [SRC] M "/foo.c" -> "/bar.c" cs:10 - [DST] R "/foo.c" cs:10MOVE_EVIL_TWIN [SRC] M "/foo.c" -> "/qux.c" cs:10 - [DST] M "/bar.c" -> "/qux.c" cs:5XLINK_CONFLICT [SRC] C "/thirdparty" Xlink ->/eb50a746-ab55-4c92-91e4-f98a62cd599f@libs@relativeServer (base Xlink ->/b69de40f-7693-46c6-a9e5-9359a162a39a@libs@relativeServer) - [DST] C "/thirdparty" Xlink ->/ba682b83-4aaf-4169-b1ad-3d8de14b371b@libs@relativeServer (base Xlink ->/b69de40f-7693-46c6-a9e5-9359a162a39a@libs@relativeServer) FILE_CONFLICT [SRC] C "/foo.c" cs:12 (base cs:7) - [DST] C "/foo.c" cs:8 (base cs:7)
Writable Xlinks conflicts that will be expanded with a new merge
XLINK_MERGE [SRC] C "/engine" wXlink ->/235163d5-99c2-4490-988d-204ddd76d963@engine@relativeServer (base wXlink ->/be492aa6-d42d-45be-a7b3-b7d0346fb74f@engine@relativeServer) - [DST] C "/engine" wXlink ->/17cb0014-3351-45f2-9ecb-bc025a43d059@engine@relativeServer (base wXlink ->/be492aa6-d42d-45be-a7b3-b7d0346fb74f@engine@relativeServer)XLINK_MERGE [SRC] C "/engine" wXlink ->/235163d5-99c2-4490-988d-204ddd76d963@engine@relativeServer (base wXlink ->/be492aa6-d42d-45be-a7b3-b7d0346fb74f@engine@relativeServer)
Operations to apply
C "/foo.c" cs:12 (base cs:7)C "/thirdparty" Xlink ->/eb50a746-ab55-4c92-91e4-f98a62cd599f@libs@relativeServer (base Xlink ->/b69de40f-7693-46c6-a9e5-9359a162a39a@libs@relativeServer)A "/foo.c" cs:7M "/foo.c" -> "/bar.c" cs:7D "/foo.c" cs:7FS "/foo.c" 777 (base 444)
This is an example for a simple merge:
CHANGE_DELETE [SRC] C "/src/foo.c" cs:12 (base cs:7) - [DST] D "/src/foo.c" cs:7FILE_CONFLICT [SRC] C "/src /bar.c" cs:12 (base cs:7) - [DST] C "/src /bar.c" cs:8 (base cs:7)M "/doc/readme.txt" -> "/readme.txt" cs:7D "/doc" cs:7
Output result
Result code from the trigger script or executable determines the success or failure of the operation:
Output result | Description |
|---|---|
| The trigger was completed successfully. |
| Non zero | The trigger reports failure. |
Environment variables
In addition to the variables defined in sections Common environment variables and server.conf variables, these are also available:
Environment variable | Description |
|---|---|
| |
| Specification of the source changeset. For example: |
| Specification of the destination changeset. For example: |
| Specification of the ancestor changeset. If there are multiple ancestors (recursive merge scenario), they will be separated by semi-colons ( |
| The list of labels applied on the source changeset, separated by semi-colons ( |
| |
| |
| |
| The strategy used to calculate the common ancestor. Allowed values: |
| |
Sample command line creation
cm trigger create before-merge merge_gate "/path/to/script" --server=myserver:8084Trigger created on position 1.
Create branch
Heading | Value |
|---|---|
| Trigger names |
|
| Description | It executes user scripts when a branch is created. |
| Runs on | Server |
Filters
You can use the following filters:
- Repository name
- Branch name
For example, if , the trigger executes only for branches whose name
starts with in the repository .
--filter="rep:default,scm*"scmdefaultStandard input
No standard input is supplied to these triggers.
Output result
Result code from the trigger script or executable determines the success or failure of the operation:
Output result | Description |
|---|---|
| The trigger completed successfully. The branch will be created. |
| Non zero | The trigger reports failure. If the trigger is |
Environment variables
In addition to the variables defined in sections Common environment variables and server.conf variables, these are also available:
Environment variable | Description |
|---|---|
| The comment given by the user at branch creation. |
| The branch that is being created. |
| The full branch name that is being created. |
| The repository name where the branch is being created. |
Create label
Heading | Value |
|---|---|
| Trigger names |
|
| Description | It executes user scripts when a label is created. |
| Runs on | Server |
Filters
You can use the following filters:
- Repository name
- Label name
For example, if , the trigger executes only for labels whose name starts
with in the repository .
--filter="rep:code,BL*"BLcodeStandard input
No standard input is supplied to these triggers.
Output result
Result code from the trigger script or executable determines the success or failure of the operation:
Output result | Description |
|---|---|
| The trigger completed successfully. The label will be created. |
| Non zero | The trigger reports failure. If the trigger is |
Environment variables
In addition to the variables defined in sections Common environment variables and server.conf variables, these are also available:
Environment variable | Description |
|---|---|
| The comment given by the user at label creation. |
| The label that is being created. |
| The repository name where the label is being created. |
| The number of the changeset being labeled. |
| The name of the owner of the changeset being labeled. |
Sample command-line creation
cm trigger create before-mklabel "Validate label" "c:\plastic\triggers\Validate-label.bat" --filter="LB*"Trigger created on position 1.cm trigger list before-mklabel1 Validate label c:\plastic\triggers\Validate-label.bat dave
Sample trigger script
The following script saves a record of created branches on the c:\plastic\triggers\labels.log.txt file.
@@echo offecho %PLASTIC_REPOSITORY_NAME% %PLASTIC_LABEL_NAME% >> c:\plastic\triggers\labels.log.txtexit 0
Create attribute
Heading | Value |
|---|---|
| Trigger names |
|
| Description | Executes user scripts when an attribute is created. |
| Runs on | Server |
Filters
You can use the following filters:
- Repository name
- Attribute name
For example, if , the trigger executes only for attribute
in the repository .
--filter="rep:code,status"statuscodeStandard input
No standard input is supplied to these triggers.
Output result
The resulting code from the trigger script or executable determines the success or failure of the operation:
Output result | Description |
|---|---|
| The trigger completed successfully. The attribute will be created. |
| Non zero | The trigger reports failure. If the trigger is |
Environment variables
In addition to the variables defined in sections Common environment variables and server.conf variables, these are also available:
Environment variable | Description |
|---|---|
| The comment given by the user at attribute creation. |
| The attribute that is being created. |
| The repository name where the attribute is being created. |
Change attribute value
Heading | Value |
|---|---|
| Trigger names |
|
| Description | It executes user scripts when the value of an attribute applied to a certain object changes. |
| Runs on | Server |
Filters
You can use the following filters:
- Repository name
- Attribute name
- Standard input
For example, if , the trigger executes only if the value of the attribute
changes and if at least one line in the standard input applies to a branch object.
--filter="STATUS,br*"STATUSStandard input
The standard input receives the following detailed information for the object whose attribute value is being changed.
If the trigger is :
before-chattvalueobject_spec attribute:"att_name" oldvalue:"old_att_value" newvalue:"new_att_value"For example:
lb:BL145 attribute:"RELEASED" oldvalue:"FALSE" newvalue:"TRUE"If the trigger is :
after-chattvalueobject_spec attribute:"att_name" value:"att_value"For example:
br:/main/task985 attribute:"STATUS" value:"OK"The meaning of the members in italic is detailed in the following table:
Member | Description |
|---|---|
| The object which changed attribute value is applied. |
| The name of the related attribute. |
| The attribute value previously to be changed. |
| The attribute value after the change. |
| The value of the attribute. |
Output result
The resulting code from the trigger script or executable determines the success or failure of the operation:
Output result | Description |
|---|---|
| The trigger completed successfully. |
| Non zero | The trigger reports failure. If the trigger is |
Environment variables
In addition to the variables defined in sections Common environment variables and server.conf variables, these are also available:
Environment variable | Description |
|---|---|
| The attribute which value is being changed. |
| The repository name where the attribute value is being changed. |
Create repository
Heading | Value |
|---|---|
| Trigger names |
|
| Description | It executes user scripts when a repository is created. |
| Runs on | Server |
Filters
You can use the following filter:
- Repository name
For example, if , the trigger executes only for repositories whose name
starts with .
--filter="rep:cod*"codStandard input
No standard input is supplied to these triggers.
Output result
The resulting code from the trigger script or executable determines the success or failure of the operation:
Output result | Description |
|---|---|
| The trigger completed successfully. The repository will be created. |
| Non zero | The trigger reports failure. If the trigger is |
Environment variables
In addition to the variables defined in sections Common environment variables and server.conf variables, these are also available:
Environment variable | Description |
|---|---|
| The repository that is being created. |
Remove repository
Heading | Value |
|---|---|
| Trigger names |
|
| Description | It executes user scripts when a repository is removed. |
| Runs on | Server |
Filters
You can use the following filter:
- Repository name
For example, if , the trigger executes only for repositories whose name
starts with .
--filter="rep:test*"testStandard input
No standard input is supplied to these triggers.
Output result
The resulting code from the trigger script or executable determines the success or failure of the operation:
Output result | Description |
|---|---|
| The trigger completed successfully. The repository will be deleted. |
| Non zero | The trigger reports failure. If the trigger is |
Environment variables
In addition to the variables defined in sections Common environment variables and server.conf variables, these are also available:
Environment variable | Description |
|---|---|
| The repository that is being deleted. |
| The repository ID that is being deleted. |
Create workspace
Heading | Value |
|---|---|
| Trigger names |
|
| Description | It executes user scripts when a workspace is created. |
| Runs on | Client. |
Filters
You can use the following filters:
- Repository name
- Workspace name
For example, if , the trigger executes only for workspace
in all repositories whose name starts with .
--filter="rep:cod*,code"codecodStandard input
No standard input is supplied to these triggers.
Output result
The resulting code from the trigger script or executable determines the success or failure of the operation:
Output result | Description |
|---|---|
| The trigger completed successfully. The workspace will be created. |
| Non zero | The trigger reports failure. If the trigger is |
Environment variables
In addition to the variables defined in section Common environment variables, the following ones are also available:
Environment variable | Description |
|---|---|
| The name given to the new workspace. |
| The path of the workspace on the client machine. |
Set selector
Heading | Value |
|---|---|
| Trigger names |
|
| Description | Executes user scripts when a workspace selector is changed. |
| Runs on | Client. |
Filters
You can use the following filters:
- Repository name
- Standard input
For example, if , the trigger executes only for repository
and if at least one line in the standard input matches .
--filter="rep:test,/main/Release*"test/main/Release*Standard input
The standard input in these triggers receives the selector contents that the client is setting.
Output result
The resulting code from the trigger script or executable determines the success or failure of the operation:
Output result | Description |
|---|---|
| The trigger completed successfully. The selector will be modified. |
| Non zero | The trigger reports failure. If the trigger is |
Environment variables
In addition to the variables defined in section Common environment variables, the following ones are also available:
Environment variable | Description |
|---|---|
| The name of the workspace which selector is being set. |
| The client path of the workspace which selector is being set. |
Comments
Selectors are modified either with the or command or with the Switch workspace to branch, Switch workspace to label or Switch workspace to changeset commands, all of them in the command-line interface or the GUI client.
setselectorswitchUpdate
Heading | Value |
|---|---|
| Trigger names |
|
| Description | It executes user scripts in the following scenarios:
|
| Runs on | Client. |
Filters
You can use the following filters:
- Repository name
- Path to be updated
- Standard input
For example, if , then the trigger executes only for repository
and if at least one of the lines in the standard input is about deleting ()
items in a path.
--filter="rep:code,D:*/lib*"codeDlibStandard input
If the trigger is , then no standard input is supplied to this trigger.
before-updateIf the trigger is , then the standard input is , where:
after-update<{0}:{1}>- is the change's type:
{0}- C: Created (new item).
- U: Updated.
- M: Modified on disk (implies not updated nor deleted).
- D: Deleted.
- is the change's path.
{1}
Output result
Result code from the trigger script or executable determines the success or failure of the operation:
Output result | Description |
|---|---|
| The trigger completed successfully. Update operation will proceed. |
| Non zero | The trigger reports failure. If the trigger is |
Environment variables
In addition to the variables defined in the Common environment variables section, the following is also available:
Environment variable | Description |
|---|---|
| The client path of the workspace that is being updated. |
| The ID of your workspace's changeset is (or was) pointing at when the update begins. |
| The ID of the changeset your workspace is (or will be) pointing at when the update finishes. |
Comments
This trigger runs on the client, so the script locations are relative to the client machine filesystems. This is an important difference to note when creating these kinds of triggers.
Create code review
Heading | Value |
|---|---|
| Trigger names |
|
| Description | It executes user scripts when a code review is created. |
| Runs on | Server |
Filters
You can use the following filters:
- Repository name
- Code review title
For example, if , the trigger executes only for code reviews
whose title starts with in the repository .
--filter="rep:development,Review*"ReviewdevelopmentStandard input
No standard input is supplied to these triggers.
Output result
The resulting code from the trigger script or executable determines the success or failure of the operation:
Output result | Description |
|---|---|
| The trigger completed successfully. The code review will be created. |
| Non zero | The trigger reports failure. If the trigger is |
Environment variables
In addition to the variables defined in sections Common environment variables and server.conf variables, these are also available:
Environment variable | Description |
|---|---|
| The repository name where the code review is created. |
| The title given to the code review. |
| |
| The user assigned to the code review, if any. Not set if no user is assigned to the code review |
| The specification of the object for which the code review has been created. Either a changeset or a branch. |
| |
| Only available in the |
Edit code review
Heading | Value |
|---|---|
| Trigger names |
|
| Description | It executes user scripts when a code review is edited. For example, the triggers will be launched when a user changes a review name, the assignee, or the status, or when a review comment is created, edited, or deleted. |
| Runs on | Server |
Filters
You can use the following filters:
- Repository name
- Code review title
For example, if , the trigger executes only for code reviews
whose title starts with in the repository .
--filter="rep:development,Review*"ReviewdevelopmentStandard input
No standard input is supplied to these triggers.
Output result
Result code from the trigger script or executable determines the success or failure of the operation:
Output result | Description |
|---|---|
| The trigger completed successfully. The code review edition is saved to the repository. |
| Non zero | The trigger reports failure. If the trigger is |
Environment variables
In addition to the variables defined in sections Common environment variables and server.conf variables, these are also available:
Environment variable | Description |
|---|---|
| The repository name where the code review is edited. |
| The title given to the edited code review. |
| |
| The user assigned to the code review, if any. Not set if no user is assigned to the code review |
| The specification of the object for which the code review has been edited. Either a changeset or a branch. |
| |
| The variable contains the identifier of the edited review. |
| The variable contains the comment that fired the trigger. This variable will be empty if the action that fired the trigger is changing the code review status or the assignee. |
| The variable reflects the action in the comment: |
Client checkout
Heading | Value |
|---|---|
| Trigger names |
|
| Description | It executes user scripts on the client when a checkout operation is executed. |
| Runs on | Client. |
Filters
You can use the following filter:
- Repository name
- Standard input
For example, if , then the trigger executes only for repository
and if at least one of the lines in the standard input is about running a checkout on a
file.
--filter="rep:code,*.json"codejsonStandard input
The standard input in these triggers receives the list of items specified by the user on the checkout operation.
Output result
The resulting code from the trigger script or executable determines the success or failure of the operation:
Output result | Description |
|---|---|
| The trigger completed successfully. Checkout operation will proceed. |
| Non zero | The trigger reports failure. If the trigger is |
Environment variables
The variables in these triggers are the same as the ones defined in section Common environment variables.
Comments
This trigger runs on the client, so the script locations are relative to the client machine filesystems. This is an important difference to note when creating these kinds of triggers.
Client checkin
Heading | Value |
|---|---|
| Trigger names |
|
| Description | It executes user scripts on the client when a checkin operation is executed. |
| Runs on | Client. |
Filters
You can use the following filters:
- Repository name
- Standard input
For example, if , then the trigger executes only for repository
and if at least one of the lines in the standard input affects an item.
--filter="rep:code,*src*"code*src*Standard input
The standard input in these triggers receives the list of items specified by the user on the checkin operation.
Output result
Result code from the trigger script or executable determines the success or failure of the operation:
Output result | Description |
|---|---|
| The trigger completed successfully. Checkin operation will proceed. |
| Non zero | The trigger reports failure. If the trigger is |
Environment variables
In addition to the variables defined in section Common environment variables, the following ones also available:
Environment variable | Description |
|---|---|
| PLASTIC_COMMENT | The comment specified by the user on the checkin operation. |
| PLASTIC_CHANGESET | Only available in the |
| PLASTIC_PENDING_MERGE_LINKS | Only available in the
For example: The variables are:
|
| PLASTIC_MERGE_LINKS | Same as |
Comments
This trigger runs on the client, so the script locations are relative to the client machine filesystems. This is an important difference to note when creating these kinds of triggers.
The trigger runs once per affected repository under an Xlink and then again for the repository where the checkin occurs. If you don't want this to happen, you can add a filter.
before-clientcheckinSecurity
Heading | Value |
|---|---|
| Trigger names |
|
| Description | It executes user scripts when a user performs an operation that has been denied through security permissions. |
| Runs on | Server |
Filters
You can use the following filter:
- Repository name
For example, if , the trigger executes only for repository .
--filter="rep:docu"docuStandard input
No standard input is supplied to this trigger.
Output result
Result code from the trigger script or executable determines the success or failure of the operation:
Output result | Description |
|---|---|
| The trigger completed successfully. Security operation will proceed. |
| Non zero | The trigger reports failure. If the trigger is |
Environment variables
In addition to the variables defined in section Common environment variables, the following ones also available:
Environment variable | Description |
|---|---|
| The information about the denied permission. |
| The denied permissions. |
| The ID of the repository where the operation is executed. |
| The name of the repository where the operation is executed. |
| The object with the denied permission. |
Replication read
Heading | Value |
|---|---|
| Trigger names |
|
| Description | It executes user scripts when a user performs a replication operation that involves reading data. This occurs:
|
| Runs on | Server |
Filters
You can use the following filter:
- Repository name
For example, if , then the trigger executes only for repository .
--filter="rep:code"codeStandard input
No standard input is supplied to these triggers.
Output result
Result code from the trigger script or executable determines the success or failure of the operation:
Output result | Description |
|---|---|
| Success. |
| Non zero | Failure. If |
Environment variables
Environment variable | Description |
|---|---|
| Complete branch specification being replicated: This is the format of the branch specification: If the trigger is If the trigger is |
Replication write
Heading | Value |
|---|---|
| Trigger names |
|
| Description | Executes user scripts when a replication operation writes data (destination side of push/pull). |
| Runs on | Server |
Filters
You can use the following filter:
- Repository name
For example, if , the trigger executes only for repository .
--filter="rep:code"codeStandard input
No standard input is supplied to these triggers.
Output result
Result code from the trigger script or executable determines the success or failure of the operation:
Output result | Description |
|---|---|
| Success. |
| Non zero | Failure. If |
Environment variables
In addition to the variables defined in sections Common environment variables and server.conf variables, these are also available:
Environment variable | Description |
|---|---|
| Complete branch specification being replicated: |
| Only available in the |
| Only available in the |
Remove branch
Heading | Value |
|---|---|
| Trigger names |
|
| Description | It executes user scripts when a branch is removed. |
| Runs on | Server |
Filters
You can use the following filters:
- Repository name
- Branch name
For example, if , the trigger executes only for those branches which
name starts with in the repository .
--filter="rep:code,dev*"devcodeStandard input
No standard input is supplied to these triggers.
Output result
The resulting code from the trigger script or executable determines the success or failure of the operation:
Output result | Description |
|---|---|
| Success. The branch will be deleted. |
| Non zero | Failure. If |
Environment variables
In addition to the variables defined in sections
Common environment variables and
server.conf variables, these are also available:
Environment variable | Description |
|---|---|
| The name of the branch that is being deleted. |
| The full name of the branch to be deleted, including the parent. |
| The repository ID where the branch is deleted. |
| The repository name where the branch is deleted. |
| The comment given by the user at branch deletion. |
Rename branch
Heading | Value |
|---|---|
| Trigger names |
|
| Description | It executes user scripts when a branch is renamed. |
| Runs on | Server |
Filters
You can use the following filters:
- Repository name
- Branch name
For example, if , the trigger executes only for branches whose name starts with in the repository .
--filter="rep:code,dev*"devcodeStandard input
No standard input is supplied to these triggers.
Output result
The resulting code from the trigger script or executable determines the success or failure of the operation:
Output result | Description |
|---|---|
| Success. The branch will be renamed. |
| Non zero | Failure. If |
Environment variables
In addition to the variables defined in sections Common environment variables and server.conf variables, these are also available:
Environment variable | Description |
|---|---|
| Current branch name. |
| Current full branch name, including the parent. |
| New branch name. |
| New full branch name, including the parent. |
| Repository ID where the branch is renamed. |
| Repository name where the branch is renamed. |
| Comment given by user when the branch is renamed. |
Remove changeset
Heading | Value |
|---|---|
| Trigger names |
|
| Description | It executes user scripts when a changeset is removed. |
| Runs on | Server |
Filters
You can use the following filters:
- Repository name
- Changeset number
For example, if , the trigger executes only for changeset in the repository .
--filter="rep:code,3276"3276codeStandard input
No standard input is supplied to these triggers.
Output result
Result code from the trigger script or executable determines the success or failure of the operation:
Output result | Description |
|---|---|
| Success. The changeset will be deleted. |
| Non zero | Failure. If |
Environment variables
In addition to the variables defined in sections Common environment variables and server.conf variables, these are also available:
Environment variable | Description |
|---|---|
| The changeset being deleted. |
| Owner of the changeset. |
| Branch the changeset belongs to. |
| Repository ID of the changeset being deleted. |
| Repository name of the changeset being deleted. |
| Comment given by the user at changeset deletion. |
Remove label
Heading | Value |
|---|---|
| Trigger names |
|
| Description | It executes user scripts when a label is removed. |
| Runs on | Server |
Filters
You can use the following filters:
- Repository name
- Label name
For example, if , the trigger executes only for labels whose name starts with in repositories whose name starts with .
--filter="rep:code*,BL*"BLcodeStandard input
No standard input is supplied to these triggers.
Output result
Result code from the trigger script or executable determines the success or failure of the operation:
Output result | Description |
|---|---|
| Success. The label will be deleted. |
| Non zero | Failure. If |
Environment variables
In addition to the variables defined in sections Common environment variables and server.conf variables, these are also available:
Environment variable | Description |
|---|---|
| The label name being deleted. |
| The branch name. |
| Number of the labeled changeset. |
| Owner of the labeled changeset. |
| Repository ID where the label is deleted. |
| Repository name where the label is deleted. |
| Comment given by user at label deletion. |
Remove attribute
Heading | Value |
|---|---|
| Trigger names |
|
| Description | It executes user scripts when an attribute is removed. |
| Runs on | Server |
Filters
You can use the following filters:
- Repository name
- Attribute name
For example, if , the trigger executes only for attribute in repositories whose name starts with .
--filter="rep:code*,resolved"resolvedcodeStandard input
No standard input is supplied to these triggers.
Output result
The resulting code from the trigger script or executable determines the success or failure of the operation:
Output result | Description |
|---|---|
| Success. The attribute will be deleted. |
| Non zero | Failure. If |
Environment variables
In addition to the variables defined in sections Common environment variables and server.conf variables, these are also available:
Environment variable | Description |
|---|---|
| The attribute name being deleted. |
| Repository ID where the attribute is deleted. |
| Repository name where the attribute is deleted. |
| Comment given by user at attribute deletion. |