ccollab admin trigger ensure-reviewed (for Subversion)

Applies to Collaborator 12.2, last modified on December 21, 2021

Description

Use the ensure-reviewed trigger to ensure that the review that was created for the specified changelist has been completed by the time you submit the changelist to the Subversion repository. If the review has not been completed, 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-reviewed [--review-id-regex <value>] <changelist-id>

Command Options

Option

Required?

Description

<changelist-id>

Yes

The changelist identifier.

--review-id-regex <value>

No

A regular expression that identifies the review ID in the commit is comment.

Installation

To install this trigger you will need to create a pre-commit hook. If you already have a pre-commit hook, you can add our tool wherever it is appropriate; otherwise you will need to create an executable hook as described in the Subversion documentation (typically a batch file under Windows or a shell script under Linux/Mac).

Example Windows batch file

"C:\Program Files\Collaborator Client\ccollab.exe" --url <collabUrl> --user <collabUser> --password <collabPasswd> --scm subversion --svn-user <svnUser> --svn-passwd <svnPasswd> --svn-repo-path %1 --svn-look-exe "C:\Program Files\Subversion\bin\svnlook.exe" admin trigger ensure-reviewed --review-id-regex "review:\s+(\d+)" %2 || exit 1

Example Linux/OSX shell script

/collab/install/ccollab --url <collabUrl> --user <collabUser> --password <collabPasswd> --scm subversion --svn-user <svnUser> --svn-passwd <svnPasswd> --svn-repo-path $1 --svn-look-exe /usr/bin/svnlook admin trigger ensure-reviewed --review-id-regex "review:\s+(\d+)" $2 || exit 1

Note our use of "exit 1" to ensure that the script terminates with a non-zero exit code if our trigger application fails.

Remarks

  • You must specify the --svn-repo-path and --svn-look-exe global options.
  • You need to specify the --svn-user and --svn-passwd global options. Also, in order for this hook to work smoothly, you will need your Subversion usernames and Collaborator logins to match (the match is case-insensitive).
  • If you have an empty password for Collaborator account (which is not recommended), you should pass an empty string as the password global option: --password ""
  • You must require developers to put the review ID somewhere in the Subversion commit message. The format of this text is completely up to you; you must supply a Java-style regular expression that identifies this text and specifically calls out the review ID inside that text using the --review-id-regex command option.

See Also

ccollab admin trigger ensure-reviewed
Subversion Integration

Highlight search results