Description
Use the ensure-content-reviewed
trigger to ensure that the review created for the specified changelist has been completed and that the file list and file contents were not changed by the time you submit the changelist. If the review has not been completed or if the review contains changed files or updated file list, the trigger blocks the submit operation and displays an error message informing the user about the problem.
Command Line Syntax
ccollab [global-options] admin trigger ensure-content-reviewed [--ignore-integrate] [--no-keywords --review-id-regex <value>] <changelist-id>
Command Options
Option |
Required? |
Description |
---|---|---|
Yes |
The changelist identifier. |
|
No |
(Perforce only.) If specified, Collaborator ignores the merge changes to the source control (that is, the trigger is not fired for these changes. See below). |
|
No |
If specified, this option disallows keyword expansion in source files. Expanding the keywords may cause Perforce to consider the files as changed. |
|
No |
A regular expression that identifies the review ID in the commit comment. |
Installation
To install the trigger, add a line like this to your Perforce Triggers list:
ccollab change-content //depot/... "/usr/bin/ccollab --url <collabUrl> --user <collabUser> --password <collabPasswd> --scm perforce --p4port <p4port> --p4client %client% --p4user <p4user> --p4passwd <p4passwd> admin trigger ensure-content-reviewed %changelist%"
Some notes:
- Specify your installation directory for
ccollab
and replace <values> with appropriate data. Also, type all parameters in a single line even though the text above occupies several lines. - The Perforce user that you specify must have at least read-only access to the repository.
- On Unix systems, Perforce incorrectly recognizes arguments that include spaces. It ignores quotes and other standard ways of indicating that the data with spaces is actually one argument. The workaround is to use a separate bash script to call our trigger.
Remarks
- The trigger ignores changelists that correspond to new branch creation. Creating a new branch does not involve changes in code, so it does not require a review.
- If your source files use Perforce RCS keywords, we would recommend using the --no-keywords command-line option to prevent keyword expansion. Expanded keywords (like
$Date$
,$Change$
and some others) may cause changes to the source code. - Perforce treats branch merge changelists like ordinary changelists as they bring changes to source code and can introduce bugs. So, by default, the trigger handles this type of changes. However, since the merge changelists often include a large number of files and since you often need to merge several branches, this approach could require cumbersome reviews to be performed many times.
To avoid possible issues, use the --ignore-integrate command-line option. If it is specified, the trigger will ignore changelists that include "merge" changes only. Make sure to review changes in one branch before merging them with other branches. - If any of Collaborator clients have the
smartbear.ccollab.upload.truncate.size
VM option set up, consider usingccollab admin trigger ensure-reviewed
instead of this trigger. This VM option truncates the uploaded files up to the specified size. As a result, theensure-diffs-reviewed
andensure-content-reviewed
triggers will compare only the remaining parts of the truncated files. - For information on Perforce triggers, see Perforce System Administrator's Guide.